Skip to content

Instantly share code, notes, and snippets.

View roolo's full-sized avatar

Mailo Světel roolo

View GitHub Profile
@roolo
roolo / gist:3834464
Created October 4, 2012 15:39
Check all chekboxes bookmarklet
javascript:var documents=[];if(window.frames.length > 0){for(i=0;i<window.frames.length;i=i+1){ documents[i]=window.frames[i].document;}}else{documents[0]=window.document;}for(i=0;i<documents.length;i=i+1){var a=documents[i].getElementsByTagName('input');for(i=0;i<a.length;i=i+1){a[i].checked='checked';}void(0);}
@roolo
roolo / My Chrome.scpt
Last active January 8, 2016 10:00
Launch chrome profile on MacOS X
do shell script "/Applications/Google\\ Chrome.app/Contents/MacOS/Google\\ Chrome --user-data-dir=\"/Volumes/PrivateHome/ChromeProfile\" > /dev/null 2>&1 &"
@roolo
roolo / gist:4314266
Created December 16, 2012 23:40
Count numbers on checked line
=SUMIF($A,"=true",$C)
@roolo
roolo / sinatra_service_errors.rb
Created January 3, 2013 13:14
Makes Sinatra to report errors in JSON and not HTML. Place it at beginning of the class of server
configure do
set :show_exceptions, false
end
error do
{error: env['sinatra.error'].message}.to_json
end
zshin, zshout, zsherr = Open3.popen3('zsh')
Find.find('../..') do |f|
if f =~ /\.git$/
repository = f.gsub /\.git$/, ''
Logger.new(STDOUT).info('Checking '){repository}
zshin.puts 'cd %s'%repository
zshin.puts 'rvm-prompt'
zshout.gets
#puts `zsh -ci "cd #{repository} && rvm-prompt && git up"`
end
@roolo
roolo / rmagick-fix.sh
Created February 6, 2013 12:16
Fixing the "Can't install RMagick 2.13.1. Can't find the ImageMagick library or one of the dependent libraries. Check the mkmf.log file for more detailed information."@Mac w/ homebrew – taken from http://blog.kenleycheung.com/2012/12/rmagick-homebre/
brew uninstall imagemagick
cd /usr/local/Cellar
git checkout 834ce4a /usr/local/Library/Formula/imagemagick.rb
brew install imagemagick
@roolo
roolo / ff.md
Created February 8, 2013 16:21
RubyMine Watchers

#RubyMine Watchers

Sinatra

  • params – self.request.params
2/16/13 12:15:52.183 AM com.apple.backupd[1490]: Created new backup: 2013-02-16-001552
2/16/13 12:16:08.992 AM com.apple.backupd[1490]: Starting post-backup thinning
2/16/13 12:16:08.992 AM com.apple.backupd[1490]: No post-back up thinning needed: no expired backups exist
2/16/13 12:16:09.097 AM com.apple.backupd[1490]: Backup completed successfully.
2/16/13 12:21:35.476 AM com.apple.backupd[3118]: Starting manual backup
2/16/13 12:21:36.023 AM com.apple.backupd[3118]: Backing up to: /Volumes/Capsule/Backups.backupdb
2/16/13 12:24:43.148 AM com.apple.backupd[3118]: Found 884279 files (75.32 GB) needing backup
2/16/13 12:25:25.793 AM com.apple.backupd[3118]: Backup canceled.
2/16/13 12:37:32.306 AM com.apple.backupd[1289]: Starting manual backup
2/16/13 12:37:32.415 AM com.apple.backupd[1289]: Backing up to: /Volumes/Capsule/Backups.backupdb
@roolo
roolo / Rakefile.rb
Last active December 14, 2015 01:19
Barby usage example
require 'barby'
require 'barby/barcode/qr_code'
require 'barby/outputter/png_outputter'
desc 'Encodes text into QR Code'
task :encode, [:text] do |t, args|
barcode = Barby::QrCode.new(args[:text])
outputter = Barby::PngOutputter.new(barcode)
File.open('barcode.png', 'w'){|f| f.write outputter.to_png }
end
@roolo
roolo / mysql2-gem-install.sh
Last active December 25, 2018 07:43
Fixing "Incorrect MySQL client library version! This gem was compiled for 5.5.29 but the client library is 5.6.10. (RuntimeError)" on OS X while using Brew
ARCHFLAGS="-arch x86_64" gem install mysql2 -- –with-mysql-config=/usr/local/bin/mysql_config