$ git clone git://github.com/author/gem_name
$ cd gem_name
install dependencies, sudo gem install xxx
$ rake gem
$ sudo gem install pkg/gem_name-1.1.1.gem
# This is used in Rails migrations to update ActiveRecord after adding/removing a column from a table | |
# so that the column can be used in the migration. Doesn't take any arguments, will update the AR | |
# model that it is called on. | |
ActiveRecord#reset_column_information | |
# Reload rails env while in script/console | |
reload! | |
# Rails field types | |
# :type MySQL type options |
$ git clone git://github.com/author/gem_name
$ cd gem_name
install dependencies, sudo gem install xxx
$ rake gem
$ sudo gem install pkg/gem_name-1.1.1.gem
Some of this is pulled directly from the git-svn man page.
git svn branch new-svn-branch
now there is a new remote tracking branch, confirm with git branch -r to push local git-branch changes to the new svn branch git checkout git-branch git rebase --onto new-svn-branch OR from master (this seems to work better) git rebase --onto new-svn-branch master git-branch
/* | |
Add a bookmark to this | |
javascript:(function(){var c=document.getElementsByTagName("link");for(var d=0;d<c.length;d++){var a=c[d];if(a.type=="text/css"){var e="css_buster_"+Math.floor(Math.random()*1000000000);var g=a.href.split("?",1);var f;if(g.length>1){var b=g[1].indexOf("&")==-1;if(b){f=e}else{f=g[1]+"&"+e}}else{f=e}a.href=g[0]+"?"+f}}})(); | |
*/ | |
(function() { | |
var links = document.getElementsByTagName('link'); | |
for (var i = 0; i < links.length; i++) { | |
var l = links[i]; | |
if (l.type == 'text/css') { |
Given a set of numbers from 0 to 2^n-1, with one missing, how would you find the missing number in one pass through the set and using at most n bits of extra storage |
require 'rubygems' | |
require 'rack' | |
class Object | |
def webapp | |
class << self | |
define_method :call do |env| | |
func, *attrs = env['PATH_INFO'].split('/').reject(&:empty?) | |
[200, {}, send(func, *attrs)] | |
end |
"TortoiseMerge.exe" "$2" "$5" | cat |
#!/usr/bin/env python | |
""" | |
fabfile.py | |
Copyright (c) 2011 Giovanni Collazo | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
I think I found a typo in your guide and I wanted to draw your attention to it. | |
In the section Data > Add users and domains > Adding template, one of your SQL lines looks like the following: | |
INSERT INTO users (id,name,maildir,clear) VALUES | |
('email@address','short description','foldername/',encrypt('password') ); | |
I think that instead of 'clear' as the last field being inserted into, you meant 'crypt' because you are encrypting a password. |
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer