Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@wynst
wynst / bash.log
Created February 13, 2016 10:37
mix install.local
```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 September 14, 2012 10:45
rake task to cleanup codebase from devilish whitespace (taken from diaspora project)
# 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
source :gemcutter
gem "rack", ">= 1.2.1"
gem "rack-rewrite", ">= 1.0.0"
#!/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 February 25, 2010 11:19
A Thor Task to unwatch *all* Github watched repositories (excluding owned) and optionally export to delicious.

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:

#!/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