In my work – every now and then – I found myself in need of a browser with reduced security checks (mainly to gloss over cross domain XMLHttpRequests and SSL certificate violations) for testing purposes. I didn’t want to take the risk and use my main browser session with these settings, so I made me a script (also available as a Gist). 🙂
If you use oh my ZSH you can save this file in ~/.oh-my-zsh/custom/plugins/chrome-unsafe/chrome-unsafe.plugin.zsh and add “chrome-unsafe” to your list of used plugins in
I got myself Bioshock 1 and 2 during Steam’s Summer Sale and just came around to play it.
After installation I found out that the game was in German (while my Windows and Steam are in English)!?!? … I hate dubbed films and games!
Sadly Bioshiock doesn’t allow you to change the language in the settings menu so I had to look around. After piecing together information from several 5+ year old, outdated forum posts I found the solution.
- Close the game
- Open C:\Users\<Username>\AppData\Roaming\Bioshock\bioshock.ini
- Find the
(“int” is for international i.e. English)
- Save the file and restart the game
Everything should be in English now. 😀
Interesting proposition: how do you report 1.2k crashes at once?
Sometimes well-intentioned features have unintended side effects. Case in point: WordPress’ maintenance mode. Whenever you update plugins WP will automatically enter maintenance mode, which displays a nice message to your visitors that the site will be back online shortly. It will automatically go out of maintenance once the updates are done.
Well, sometimes unexpected things happen: you are stuck in maintenance mode. WP will effectively lock you out … even the admin section will not be accessible. *ugh* This is the moment you start panicking … luckily if you wait 10 minutes or delete the .maintenance file manually you’ll be able to access your site again. *phew*
Just went though that whole cycle. m(
I just felt the need for a script that could extract the audio track of a video, transcode it and save it as an mp3 file … 2 hours later I was finished (get the Gist). 😀 It uses VLC to do hard work. 😉
Thanks to Kris Hom for the inspiration. 🙂
- Check whether VLC is installed
- Should also work on Linux now
- Increase default bit rate to 192kbit/s
- Fixed bug where the file/playlist would repeat endlessly
- Also look for VLC in “~/Application/”
- Added a ffmpeg version
Let’s say you read settings from a YAML file and have some sort of settings object. Then you check if certain options are set with custom values or you have to set default/fall-back values on them. If you are dealing with Boolean options you have to be careful … as I had to find out myself.
Initially you would probably do something like the following to set a default value on a Boolean option:
settings[:some_option] ||= true # set default value if nothing set
Do you see the problem? What happens if the option was deliberately set to
? You would overwrite it because both cases
(i.e. nothing set) and
would evaluate to
in the context of the
operator and you would in both cases assign the right hand value (and overriding an explicit user choice in one case) … *ouch*.
So the correct solution is something like the following:
settings[:some_option] = true if settings[:some_option].nil?
Just be careful … 😀
If you ever needed a way to render a Rails assets to a string, Hongli Lai from Phusion describes how. 🙂
I prepared a Gist wrapping it into a nice helper. 😀
# thanks to http://blog.phusion.nl/2011/08/14/rendering-rails-3-1-assets-to-string/
# you may need to change the owner of the tmp/cache/* directories to the web servers user
# e.g. for Debian systems: `chown -R www-data:www-data tmp/cache/*`
Just realized Ruby’s File.basename can also filter out (arbitrary) file extensions. 😀
File.basename("foo/bar/baz.html", ".*") #=> "baz"