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
FactoryGirl.define do | |
factory :model_name do | |
name "Name" | |
description "Description" | |
registered_at Time.zone.now | |
end | |
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
- hosts: | |
- localhost | |
connection: local | |
vars: | |
- rbenv_root: /home/www/.rbenv | |
- ruby_version: 2.1.5 | |
tasks: |
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 Zzz | |
end | |
module XxxRole | |
def behavior_as_x | |
puts "zzz is xxx." | |
end | |
end | |
module YyyRole |
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
postgres=# CREATE TABLE orders ( product_id integer, ordered_at timestamp with time zone, CONSTRAINT pkey PRIMARY KEY (product_id, ordered_at) ) ; | |
CREATE TABLE | |
postgres=# \d orders | |
Table "public.orders" | |
Column | Type | Modifiers | |
------------+--------------------------+----------- | |
product_id | integer | not null | |
ordered_at | timestamp with time zone | not null | |
Indexes: |
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 | |
for ($n = 1; $n <= 20; $n++) { | |
echo (($n % 3 == 0 ? "Fizz" : "") . ($n % 5 == 0 ? "Buzz" : "")) ? (($n % 3 == 0 ? "Fizz" : "") . ($n % 5 == 0 ? "Buzz" : "")) : (string)$n; | |
echo "\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
<?php | |
class FizzBuzz | |
{ | |
private $n; | |
private $fizzSpec; | |
private $buzzSpec; | |
private $noFizzBuzzSpec; |
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 | |
files=`git diff --cached --name-only` | |
assets_path=`git config assets.path` | |
[ -z "$assets_path" ] && exit 0 | |
for file in $files | |
do | |
if [[ "$file" =~ "^$assets_path" ]]; then |
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
object Fib extends App { | |
def fib(n: Int): Int = { | |
if (n < 2) { return n } else { return fib(n-1) + fib(n-2) } | |
} | |
Console.println("fib(1) = " + fib(1)); | |
Console.println("fib(2) = " + fib(2)); | |
Console.println("fib(3) = " + fib(3)); | |
Console.println("fib(4) = " + fib(4)); | |
Console.println("fib(5) = " + fib(5)); | |
Console.println("fib(6) = " + fib(6)); |
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 | |
class AbstractEntity implements EntityInterface | |
{ | |
} |
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 | |
class Status | |
{ | |
private $value; | |
private static $instances = array(); | |
private function __construct($value) | |
{ |