Skip to content

Instantly share code, notes, and snippets.

@bonyiii
bonyiii / gist:1103689
Created July 25, 2011 07:08
capistrano recipe
# https://rvm.beginrescueend.com/integration/capistrano/
# sudo and scons must be installed even though i don't want to use sudo at all. And i don't change user.
# also for git clone to work i have to set up ssh key in .ssh
$:.unshift(File.expand_path('./lib', ENV['rvm_path'])) # Add RVM's lib directory to the load path.
require "rvm/capistrano" # Load RVM's capistrano plugin.
set :rvm_ruby_string, 'ruby-1.9.2@rails31' # Or whatever env you want it to run in.
set :rvm_type, :user # Copy the exact line. I really mean :user here
#http://blog.josephholsten.com/2010/09/deploying-with-bundler-and-capistrano/
require 'bundler/capistrano'
http://overlays.gentoo.org/proj/sunrise
@bonyiii
bonyiii / bash ctrl history search
Last active September 26, 2015 08:08
ctrl + up and ctrl + down in history
@bonyiii
bonyiii / gist:1058416
Created July 1, 2011 12:08
delete remote or local git tag
http://nathanhoad.net/how-to-delete-a-remote-git-tag
#remote
git tag -d 12345
git push origin :refs/tags/12345
#local
git tag -d v0.2_cucumber
@bonyiii
bonyiii / gist:1037357
Created June 21, 2011 06:43
delete all gem
'gem list | cut -d" " -f1 | xargs gem uninstall -aIx'
# vagy
for I in $(gem list | cut -d" " -f1); do gem uninstall -aIx $I; done
@bonyiii
bonyiii / gist:1031331
Created June 17, 2011 12:26
prototype class.create in jquery
/* http://flydillonfly.wordpress.com/2011/05/06/writing-oo-javascript-using-jquery/ */
var Flat = function () {};
Flat.prototype = {
initialize: function () {
$("#myButton").click($.proxy(this.displayMessage, this))
},
add: function(e) {
@bonyiii
bonyiii / gist:1004044
Created June 2, 2011 07:04
postgresql show columns from 'table'
SELECT column_name, data_type, udt_name, character_maximum_length FROM information_schema.columns WHERE table_name = 'table';
@bonyiii
bonyiii / gist:992770
Created May 26, 2011 08:26
how to know when a file was deleted from git
# source: http://stackoverflow.com/questions/953481/restore-a-deleted-file-in-a-git-repo
Use git log --diff-filter=D --summary to get all the commits which have deleted files and the files deleted;
Use git revert $commit to revert that particular commit.
Using --summary instead of --name-only displays the actions taken.
@bonyiii
bonyiii / gist:986407
Created May 23, 2011 08:38
rails 3 w unicorn to log into console
https://gist.github.com/983588
#Put this in application.rb, or in a rake task initialize code
if defined?(Rails) && (Rails.env == 'development')
Rails.logger = Logger.new(STDOUT)
end
@bonyiii
bonyiii / gist:980302
Created May 19, 2011 06:43
incomatible character encodings ruby 1.9.2
A postgresql klien library -k mindenképp kellettek ahhoz 1.9.2 alatt jó legyen a db karakter kódólás
A postgresql-base -t kellett telepíteni ahhoz, hogy a pg gem jól működjön ruby 1.9.2 alatt és rendesen kezelje az utf-8 karaktereket.
Utána letöröltem a pg -t és újra installáltam gem install -al. Nem biztos, hogy ez a lépés is kellett de ártani nem ártahat.
Error 'incompatible character encodings: ASCII-8BIT and UTF-8' with Rails 3.0.5 and Ruby 1.9.2p136