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
Testouille de push sur github. | |
Wesh wesh ! | |
Devinette : | |
Que faire quand une blonde vous envoie une grenade ? | |
Réponse : | |
La dégoupiller et lui renvoyer ! | |
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
<div class="help"> | |
<h1>Help for you !</h1> | |
<p><%= yield %></p> | |
</div> | |
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
<html> | |
<head><title>Hihi Velib !</title></head> | |
<body> | |
<?php | |
//TODO: show time, in order to check that the page have fresh data + refresh link on it | |
function get_station_datas($station_number) { | |
$url = "http://www.velib.paris.fr/service/stationdetails/{$station_number}"; | |
$xml = simplexml_load_file($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
<?php | |
// Parse juste un seul flux Rss, ya rien à voir, circulez ^^ | |
$url = "http://alsquire.tumblr.com/rss"; // A remplacer | |
?> | |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
<meta http-equiv="Content-style-type" content="text/css" /> |
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
class Fixnum | |
def add_toto(val) | |
return "la tete a toto" if val == 0 && self == 0 | |
old_add(val) | |
end | |
alias old_add :"+" | |
alias :"+" add_toto | |
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
# Ok, forget the other method, just use ActiveSupport Inflector (from which version ?) | |
$KCODE = 'UTF-8' # For Windows. | |
# But a string with accents typed in the Windows command line will still have a NoMethodError 'normalize'. | |
require 'rubygems' | |
gem 'activesupport' | |
require 'activesupport' | |
txt = "Hé hoé Huhuh, tu as déjà vu du kawaï sur une adresse@mail.com ? CAPitALE !" |
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
gem "thoughtbot-shoulda", :lib => "shoulda", :source => "http://gems.github.com" if yes?('Use shoulda gem?') | |
gem "thoughtbot-factory_girl", :lib => "factory_girl", :source => "http://gems.github.com" if yes?('Use factory_girl gem?') | |
gem "mocha" if yes?('Use mocha gem?') | |
gem "haml" if yes?('Use haml gem?') | |
if yes?('Git init?') | |
git :init | |
file '.gitignore', <<-EOF | |
log | |
tmp | |
db/*.sqlite3 |
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
"ta mere" / [:bus] # => Ta mère en string sur un arrêt de bus |
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 'activesupport' | |
# class Hash | |
module Enumerable | |
def dig(*keys) | |
s = self | |
keys.all? do |key| | |
s = s[key] | |
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
detach subdirectory: | |
You want to clone your repository and then use git filter-branch to mark everything but the subdirectory you want in your new repo to be garbage-collected. To clone your local repository: | |
$ git clone --no-hardlinks /XYZ /ABC | |
The --no-hardlinks switch makes git use real file copies instead of hardlinking when cloning a local repository. The garbage collection and pruning actions will only work on blobs (file contents), not links. | |
Then just filter-branch and reset to exclude the other files, so they can be pruned: |
OlderNewer