Skip to content

Instantly share code, notes, and snippets.

@wynst
wynst / bash.log
Created Feb 13, 2016
mix install.local
View bash.log
```bash
$ rhc ssh -a myapp
[myapp rhcloud.com myroot]\> export PATH=$OPENSHIFT_ERL_DIR/usr/bin/:$PATH
[myapp.rhcloud.com myroot]\> cd $OPENSHIFT_TMP_DIR
[myapp.rhcloud.com tmp]\> mix local.hex
=PROGRESS REPORT==== 13-Feb-2016::03:26:25 ===
supervisor: {local,sasl_safe_sup}
started: [{pid,<0.33.0>},
{id,alarm_handler},
@wynst
wynst / whitespace.rake
Created Sep 14, 2012
rake task to cleanup codebase from devilish whitespace (taken from diaspora project)
View whitespace.rake
# rake task to cleanup codebase from devilish whitespace
# works on OSX, on linux the :new_line_at_eof task should be `sed '$a\'`
#
# at the end of the day, 'cleanup whitespace' commit that cleans up all the whitespace
# wouldn't worth to be included in the repo. this is because
# `git blame` will fail with many 'cleanup whitespace' commits
#
# ref:
# https://www.chiliproject.org/issues/436
# https://github.com/diaspora/diaspora/commits/master/lib/tasks/whitespace.rake
View Gemfile
source :gemcutter
gem "rack", ">= 1.2.1"
gem "rack-rewrite", ">= 1.0.0"
View rotate_video.rb
#!/usr/bin/env ruby
# put in /home/username/bin
# USAGE : rotate_video.rb filename
original = ARGV.shift
ext = File.extname(original)
rotated = original.gsub(ext, "[rotated]" + ext)
system "mencoder -vf rotate=1 -o '#{ rotated }' -oac copy -ovc lavc '#{ original }'"
@wynst
wynst / README.MD
Created Feb 25, 2010
A Thor Task to unwatch *all* Github watched repositories (excluding owned) and optionally export to delicious.
View README.MD

A Thor Task to unwatch all Github watched repositories (excluding owned) and optionally export to delicious.

Sorry Github, for I have sinned. I use the Watch feature as a bookmarker.

Install required gems:

gem install thor rest-client

Use it as such:

View folder_to_zip.rb
#!/usr/bin/env ruby
Dir["*"].each do |file|
if File.directory?(file)
#tODO add OS spesific,
# if win use 7z instead.
`zip -r "#{file}.zip" "#{file}"`
end
end