This is a very simple git workflow. It (and variants) is in use by many people. I settled on it after using it very effectively at Athena. GitHub does something similar; Zach Holman mentioned it in this talk.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "bufio" | |
| "fmt" | |
| "io" | |
| "os" | |
| ) | |
| func main() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Array | |
| # Converts [[k1,v1],[k2,v2]] into {k1 => v1, k2 => v2} | |
| # The opposite of Hash#to_a | |
| # Same as `Hash[ary.flatten]` | |
| def to_h | |
| inject({}) {|h,el| h[el[0]] = el[1]; h } | |
| end | |
| end |
I hereby claim:
- I am bmarini on github.
- I am benmarini (https://keybase.io/benmarini) on keybase.
- I have a public key whose fingerprint is 071F BE82 8D4C 65BA D311 A8BA FC0E E0BF 8831 987C
To claim this, I am signing this object:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #/bin/bash | |
| # Builds a gc patched ruby according to: | |
| # http://guides.rubyonrails.org/benchmarking_and_profiling.html#_performance_test_cases | |
| mkdir ${HOME}/rubygc | |
| mkdir -p ${HOME}/src | |
| # 1. Compile | |
| echo "-- compiling ruby from source with gc patch --" | |
| cd ${HOME}/src |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # a quick and dirty backup script. | |
| # if you have a websites folder and some databases to backup | |
| # this script might be a good starting point. | |
| # this script assumes you have user named admin. | |
| BASE_DIR='/' | |
| TARGET_DIR='sites' | |
| BACKUP_TIME=`date +%Y%m%d%H%I%S` | |
| BACKUP_FILENAME="${BACKUP_TIME}-${TARGET_DIR}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| === Epic Snow Leopard Upgrayyyyd Guide === | |
| More info here: http://www.gregbenedict.com/2009/08/29/fixing-ruby-gems-mysql-and-passenger-phusion-on-snow-leopard-10-6/ | |
| Son, you’re now living in the land of 64-bit systems. | |
| That means that some of your 32-bit shit is now broken. | |
| Not all is lost. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Example for .bashrc: | |
| export LSCOLORS="exfxcxdxbxegedabagacad" | |
| a black | |
| b red | |
| c green | |
| d brown | |
| e blue | |
| f magenta | |
| g cyan |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo atsutil databases -remove | |
| atsutil server -shutdown | |
| atsutil server -ping |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module AverageTimeOfDay | |
| require 'date' | |
| # Assumes times_of_day is an array of valid time strings in chronological | |
| # order. | |
| def average_time_of_day(times_of_day) | |
| # Convert times_of_day to an array of Time objects, ensuring that times | |
| # are in chronological order by adding a day if the the time of the | |
| # current iteration is earlier than the last iterated time. | |
| times = times_of_day.inject([]) do |times, time_of_day| | |
| dt = DateTime.strptime(time_of_day, "%I:%M%p") |
OlderNewer