Skip to content

Instantly share code, notes, and snippets.

@asmega
asmega / gist:4293943
Created December 15, 2012 11:26
apparent way to concat pdf files
Ghostscript can also concatenate multiple pdf files into a single one. This only works well if the PDF files are "well behaved".
# gs -q -sPAPERSIZE=a4 -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=all.pdf \
file1.pdf file2.pdf ... # On Windows use '#' instead of '='
@asmega
asmega / gist:4337665
Created December 19, 2012 15:44
yard doc
be yard doc --list-undoc
@asmega
asmega / gist:5183014
Created March 17, 2013 18:47
mac linear mouse
defaults read -g com.apple.mouse.scaling
defaults write -g com.apple.mouse.scaling 10
@asmega
asmega / gist:5377856
Last active December 16, 2015 04:29
left 4 dead l4d add ons
cp X /Users/asmega/Library/Application\ Support/Steam/SteamApps/common/left\ 4\ dead\ 2/left4dead2/addons
@asmega
asmega / gist:5426912
Created April 20, 2013 18:31
rails generate migration with orm
be rails g migration create_structures --orm=active_record
@asmega
asmega / gist:6778742
Created October 1, 2013 13:51
clone/duplicate a mysql database
mysqldump -h [server] -u [user] -p[password] db1 | mysql -h [server] -u [user] -p[password] db2
@asmega
asmega / gist:7353263
Created November 7, 2013 11:38
ruby server
ruby -run -e httpd . -p 3002
@asmega
asmega / gist:8349303
Created January 10, 2014 09:52
manually create dummy app where rails is not available - Rails 3.2.16
require '~/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/railties-3.2.16/lib/rails/generators'
require '~/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/railties-3.2.16/lib/rails/generators/rails/plugin_new/plugin_new_generator'
g = Rails::Generators::PluginNewGenerator.new(dummy_path: "test/dummy")
g.send :create_dummy_app, "test/dummy"
@asmega
asmega / gist:3468ec8f4571cada07c2
Created September 21, 2014 20:18
pdf page extract
convert -density 300 odd.pdf\[0\] 0.pdf
@asmega
asmega / gist:cff2c3ba56a23e3cf8d7
Last active December 12, 2021 17:02
static site
wget -k -E -r -l 10 -p -N -F -nH http://localhost:3000
wget -P build -k -E -r -l 10 -p -N -F -nH http://localhost:3000