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
$ ruby | |
puts "Hello, World!" | |
^D | |
Hello, World! | |
$ ruby -e 'puts "Hello, World!"' | |
Hello, World! | |
$ irb | |
>> puts "Hello, World!" |
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
require 'rubygems' | |
require 'nokogiri' | |
require 'open-uri' | |
Nokogiri::HTML(open('http://www.google.com/search?q=tenderlove')).xpath('//h3/a[@class="l"]').each do |link| | |
puts link.content | |
end |
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
jQuery(function($){ | |
$('ol.reversed > li').each(function(){ | |
$(this).prependTo($(this).parent()); | |
}); | |
}); |
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
<?php | |
$story = <<<FOO | |
Lorem ipsum dolor sit amet, consectetur adipiscing elit. | |
Etiam lacinia nibh eleifend mauris dignissim bibendum. | |
Suspendisse vitae turpis sit amet velit vehicula malesuada. | |
FOO; | |
?> |
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
// Recursive submodule init update | |
git submodule foreach --recursive 'git submodule init && git submodule update' | |
// Push de la branche locale 'machin' vers la branche distante 'chose' | |
git push origin/machin:chose | |
// Renommer une branche | |
git branch -m <nouveau-nom> | |
// Stashing for later |
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
mkdir myapp && cd $_ | |
git init | |
git submodule add http://github.com/symfony/symfony1.git lib/vendor/symfony | |
git submodule foreach --recursive 'git submodule init && git submodule update' | |
php lib/vendor/symfony/data/bin/symfony generate:project myapp | |
ln -s ../lib/vendor/symfony/data/web/sf web/ | |
./symfony generate:app frontend |
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
function walkTheDOM(node, func) { | |
func(node); | |
node = node.firstChild; | |
while (node) { | |
walkTheDOM(node, func); | |
node = node.nextSibling; | |
} | |
} |
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
function getElementsByClassName(className) { | |
var results = []; | |
walkTheDOM(document.body, function (node) { | |
var a, c = node.className, i; | |
if (c) { | |
a = c.split(' '); | |
for (i = 0; i < a.length; i += 1) { | |
if (a[i] === className) { | |
results.push(node); | |
break; |
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
<a href="/legalbox/lb_js_scalableApp/issues/1/close" class="minibutton btn-close-pull-request bigger lighter" onclick="var f = document.createElement('form'); f.style.display = 'none'; this.parentNode.appendChild(f); f.method = 'POST'; f.action = this.href;var s = document.createElement('input'); s.setAttribute('type', 'hidden'); s.setAttribute('name', 'authenticity_token'); s.setAttribute('value', 'a6f416ab5b919087af9f2fbabc7748e298f495ff'); f.appendChild(s);f.submit();return false;"> | |
<span><span class="icon"></span>Close Pull Request</span> | |
</a> |
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
curl -X POST --header "X-Requested-With: XMLHttpRequest" http://example.org/time.json |
OlderNewer