This file contains 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
cd /tmp | |
git clone git://git.kernel.org/pub/scm/git/git.git | |
cd git | |
git checkout v`git --version | awk '{print $3}'` | |
cp contrib/completion/git-completion.bash ~/.git-completion.bash | |
cd ~ | |
rm -rf /tmp/git | |
echo -e "source ~/.git-completion.bash" >> .profile |
This file contains 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
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button Value') |
This file contains 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
import System.Linq.Enumerable | |
words = ("blueberry", "chimpanzee", "abacus", "banana", "apple", "cheese") | |
wordGroups = words.GroupBy({ w | w[0] }) | |
for g in wordGroups: | |
print "Words that start with the letter $(g.Key):" | |
for word in g: print "\t$word" |
This file contains 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/sh | |
# | |
# This script will make WinMerge your default tool for diff and merge. | |
# It must run inside git bash (on Windows) | |
# | |
# | |
# If you experience path issues you should give a try to the gist | |
# created by markusobrist at https://gist.github.com/1010253 |
This file contains 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
# Bit.ly API implementation - thanks to Richard Johansso http://gist.github.com/112191 | |
require 'httparty' | |
class Api::Bitly | |
include HTTParty | |
base_uri 'api.bit.ly' | |
format :json | |
# Usage: Bitly.shorten("http://example.com") | |
def self.shorten(url) |
This file contains 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
#!/usr/bin/env ruby | |
#-*- coding: utf-8 -*- | |
def √(n) | |
Math::sqrt(n) | |
end | |
class Numeric | |
def ±(n) | |
r = [self + n, self - n] |
This file contains 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
Passos que segui para conseguir instalar a gem mysql2, | |
pois o comando de forma tradicional gem install mysql2 não estava funcionando. | |
1) locate mysql_config | |
Não listava nada, porém tenho mysql rodando aqui com PHP. | |
2) brew install mysql | |
3) locate mysql_config | |
/Applications/MAMP/Library/bin/mysql_config |
This file contains 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/sh | |
# | |
# This script will make WinMerge your default tool for diff and merge. | |
# It must run inside git bash (on Windows) | |
# | |
# If your WinMerge is in other place then this one, please edit | |
WINMERGE_SCRIPT="winmerge-merge.sh" |
This file contains 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 | |
### BEGIN INIT INFO | |
# Provides: APPLICATION | |
# Required-Start: $all | |
# Required-Stop: $network $local_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Start the APPLICATION unicorns at boot | |
# Description: Enable APPLICATION at boot time. | |
### END INIT INFO |
This file contains 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
#Output | |
<div class="section"> | |
<h3>Sample Title</h3> | |
<div class="in"> | |
<div class="field"> | |
<label>Date</label><br/> | |
<input id="name" name="name" type="text"> | |
</div> | |
</div> | |
</div> |
OlderNewer