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
#!/usr/bin/env ruby | |
# Put this file in your PATH and give it execution rights, run to have a commands.yml example. | |
# Alias it and/or remove .rb extension for convenience. | |
# Usage: | |
# commands.rb [ALIAS_OR_NUMBER [ARGS]] | |
# TODO: stdin and stdout for shell compatibility (useful?) | |
require 'readline' | |
require 'yaml' |
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 Card | |
include Comparable | |
NUMBERS = 1..13 | |
COLORS = [:coeur, :carreau, :trefle, :pique] | |
attr_accessor :number, :color | |
def initialize(number, color) | |
@number = number |
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
/** | |
* Welcome to Pebble.js! | |
* | |
* This is where you write your app. | |
*/ | |
var UI = require('ui'); | |
var ajax = require('ajax'); | |
function fetchJSON(url) { |
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
{ | |
"Akantor":"Water: X, Dragon: XXX", | |
"Basarios":"Fire: X, Water: XX, Thunder: X, Ice: X, Dragon: XX", | |
"Ruby basarios":"Fire: X, Water: X, Thunder: X, Ice: XX", | |
"Brachydios":"Water: XX, Ice: X", | |
"Raging brachydios":"Water: X, Ice: XX", | |
"Cephadrome":"Water: X, Thunder: XX, Ice: XXX", | |
"Congalala":"Fire: XX, Water: X, Thunder: X, Ice: X", | |
"Emerald congalala":"Fire: X, Water: XX, Thunder: X, Ice: XXX", | |
"Daimyo hermitaur":"Fire: XXX, Thunder: XXX, Ice: X", |
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
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>GW2API - AngularJS</title> | |
<link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet"> | |
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.1.4/angular.min.js"></script> | |
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.1.4/angular-resource.min.js"></script> | |
<script src="script.js"></script> |
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
# Description: | |
# Ouai WebLapine ! See https://github.com/AlSquire/WebLapine | |
# | |
# Commands: | |
# anything with http://www.example.com - Saved to WebLapine | |
# hubot links - The Weblapine uri for the current irc channel | |
# hubot addlog <quote> - Record <quote> | |
# hubot log - Random quote | |
# hubot log + - Details about the last displayed quote (more + for deeper history) | |
# hubot log <term> - Search quotes for <term> |
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
# Disons qu'on a deux tables | |
# | |
# users | |
# - id | |
# - name | |
# - extra | |
# | |
# comments | |
# - id | |
# - user_id |
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
# * I think some attr should be filtered by controllers, | |
# while others by models (ie. computed values, as counter_cache) | |
# * Casting http params should not be the model direct responsibility ("1" => true, urg) | |
# * Using multiple controllers for a same model would be more convenient | |
# * I would love controllers to be more declarative | |
class Comment < ActiveRecord::Base | |
belongs_to :user # user_id (integer) | |
belongs_to :post # post_id (integer) | |
# title (string) |
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
window do | |
before { run 'cd /Users/arnaud/yooplr' } | |
run "autotest -cf" | |
end | |
window do | |
before { run 'cd /Users/arnaud/yooplr' } | |
tab "mate .", |
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
# Growl autotest module I use with Rails 3 RC Test::Unit | |
module Autotest::Growl | |
def self.growl(title, msg, img = nil) | |
cmd = "growlnotify -n autotest -m \"#{msg}\" \"#{title}\"" | |
cmd += " --image \"#{img}\"" if img | |
system cmd | |
end |
NewerOlder