Setup Tips
Rails with SSL in development with POW and Tunnelss
published Sunday, February 09, 2014
Updated 2014-09-17: Recommend Tunnelss (extra 's') instead of Tunnels to provide valid certificate for .dev domains. (Use carefully, .dev is now a legitimate TLD)
I'm using Pow for running Ruby on Rails Apps in development. One thing not provided by Pow but important to me, is the ability to use SSL in development. For this, I use Tunnelss
Once setup, you'll need to make it run everytime you start your computer, and on OS X Mavericks using rbenv, this can be done by creating the following file:
/Library/LaunchDaemons/org.rubygems.tunnelss.plist
Make sure to adjust the tunnels path to your system
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.rubygems.tunnelss</string>
<key>ProgramArguments</key>
<array>
<string>/Users/seb/.rbenv/shims/tunnelss</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>UserName</key>
<string>root</string>
</dict>
</plist>
Watch 3D Half/Full SBS MKV files in 2D with VLC 2.0.5
published Wednesday, April 03, 2013
Just got a movie in 3D Half/Full SBS MKV and trying to play it with VLC 2.0.5 just show up the 2 images side by side. One solution is to watch it as regular 2D movie by using the script below:
#!/bin/bash
#
# VLC 3D, version 0.2, 2013-04-03 by Sébastien Grosjean
#
# Allow to watch 3D Half/Full SBS MKV files in 2D with VLC 2.0.5
if [ -n "$1" ]
then
/Applications/VLC.app/Contents/MacOS/VLC --video-splitter=wall --wall-cols=2 --wall-rows=1 --wall-element-aspect=16:10 --wall-active=0,1 --monitor-par=1:2 "$1"
else
echo "Usage: Pass the 3D SBS mkv file as an option."
echo "For subtitles, use :"
echo "- right align (VLC > Preferences > Subtitles & OSD > Show All > Input / Codecs > Subtitles codecs > Subtitles > Subtitle justification > Right)"
echo "- and smaller font (VLC > Preferences > Subtitles & OSD > Display Settings > Font Size > Smaller)"
fi
exit
Notice the work around for subtitles, making them smaller and right aligned.
PNG Optimization and PNG to favicon on OSX Mountain Lion
published Wednesday, March 20, 2013
PNG Optimization
It's always good to save a few bits when you deliver images on the web, a lot of information can be stripped out of an image without quality loss. To do so on OS X, currently Mountain Lion, I like 2 options:
Batch Convertion
Using ImageOptim
Command line
Using pngcrush
Install
brew update
brew install pngcrush
Usage
pngcrush -rem allb -brute -reduce favicon-32x32.png favicon-32x32-crushed.png
PNG convertion to ICO
Install
brew update
brew install png2ico
Usage
png2ico --colors 16 favicon.ico favicon-32x32-crushed.png