Skip to content

Instantly share code, notes, and snippets.

@ebeigarts
ebeigarts / carrierwave_with_nginx.md
Last active August 29, 2015 13:57
Carrierwave + nginx X-Accel-Redirect

Carrierwave + nginx X-Accel-Redirect

nginx.conf

location /protected {
  internal;
  alias /var/www/myapp/current/protected;
}
@ebeigarts
ebeigarts / oatmeal_cookies.md
Last active August 29, 2015 14:02
Oatmeal cookies

Oatmeal cookies

Ingredients

  • 1 cup old fashioned oats
  • 1½ tablespoons chia seeds
  • ¼ cup oat milk
  • goji berries
# Become root
su -
# Add multimedia source
echo "deb http://www.deb-multimedia.org jessie main non-free" > /etc/apt/sources.list.d/deb-multimedia.org.list
echo "deb-src http://www.deb-multimedia.org jessie main non-free" >> /etc/apt/sources.list.d/deb-multimedia.org.list
apt-get update
apt-get install deb-multimedia-keyring # if this aborts, try again
apt-get update
@ebeigarts
ebeigarts / gist:179442
Created September 1, 2009 22:48
Ruby + Oracle + Snow Leopard
= Ruby + Oracle + Snow Leopard
Jāuzliek 64bit InstantClient:
http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/intel_macsoft.html
$ su -
$ export DYLD_LIBRARY_PATH=/path/to/instantclient
$ cd /path/to/instantclient && ln -s libclntsh.dylib.10.1 libclntsh.dylib
jQuery Visualize Plugin: Accessible Charts & Graphs from Table Elements using HTML 5 Canvas
http://www.filamentgroup.com/lab/jquery_visualize_plugin_accessible_charts_graphs_from_tables_html5_canvas/
Bluff is a JavaScript port of the Gruff graphing library for Ruby.
http://bluff.jcoglan.com/
Open Flash Chart II Plugin for Ruby on Rails - Graphs (we have used this before for interactive charts)
http://pullmonkey.com/projects/open_flash_chart2/
Interactive JS charts for your website (free for personal use):
cat ~/.ssh/id_dsa.pub | ssh user@server "cat >> .ssh/authorized_keys"
cat ~/.ssh/id_rsa.pub | ssh user@server "cat >> .ssh/authorized_keys"
#!/usr/bin/ruby
at_exit do
raise "X" rescue nil
end
at_exit do
nil
end
@ebeigarts
ebeigarts / gist:1167680
Created August 24, 2011 09:35
VM benchmarks

Linode 768Mb, 4 cores

Benchmark Run: Wed Aug 24 2011 11:28:37 - 11:56:54
4 CPUs in system; running 1 parallel copy of tests

Dhrystone 2 using register variables       22392251.5 lps   (10.0 s, 7 samples)
Double-Precision Whetstone                     2722.9 MWIPS (9.9 s, 7 samples)
Execl Throughput                               1004.0 lps   (29.9 s, 2 samples)
File Copy 1024 bufsize 2000 maxblocks        243715.4 KBps  (30.0 s, 2 samples)
@ebeigarts
ebeigarts / devise.lv.yml
Created September 19, 2011 11:19
Latvian translation for Devise
# https://gist.github.com/gists/1226317
# Additional translations at http://github.com/plataformatec/devise/wiki/I18n
lv:
errors:
messages:
expired: 'derīgums beidzies, lūdzu piesakieties jaunam'
not_found: 'netika atrasts'
already_confirmed: 'ir jau apstiprināts, lūdzu mēģiniet pieslēgties'
not_locked: 'netika nobloķēts'
@ebeigarts
ebeigarts / gist:1245145
Created September 27, 2011 14:16
Resizing images

Resizes and converts pictures in the current directory to out/.

ImageMagick provides the mogrify command.

Options:

  • -colorspace RGB - converts CMYK to RGB (needed for TIFFs)
  • -density 72 - sets DPI to 72 (needed for TIFFs)