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
#include <stdio.h> | |
#include <string.h> | |
#include "zlib.h" | |
#define TABLE_SIZE 50000 | |
struct _Word { | |
char *word; | |
uInt count; | |
}; |
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> | |
<title>popout testing</title> | |
<style type="text/css"> | |
#canvas{ | |
height:412px; | |
width:915px; | |
background-image: url('canvas.jpg'); | |
} |
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
<?php | |
include_once dirname(__FILE__)."/../../config.php"; | |
//use global varible to pass the success/false flag to prevent $this and return | |
//Assertion | |
static $testResult = true; | |
function should_be_true($value){ |
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
def live_number(birthday) | |
reduce("#{birthday.year}#{birthday.month}#{birthday.day}") | |
end | |
def reduce(sum) | |
add_sum = each_digits(sum).reduce(:+) | |
add_sum >= 10 ? reduce(add_sum) : add_sum | |
end | |
def each_digits(num) |
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
#true/false | |
target.should be | |
# can connect to every method that ends with ? | |
#ex : | |
target.should be_admin | |
# check target.admin? | |
target.should be_true | |
target.should be_false |
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
#loadfile: | |
$: | |
$LOAD_PATH | |
require File.join(File.dirname(__FILE__), "foo", "bar") #=> "file/foo/bar" | |
#or | |
require File.expand_path(File.join(File.dirname(__FILE__), "foo", "bar")) | |
#=> "path/to/file/foo/bar" | |
require "foo/bar" #=> relative to loadpath, do this in relative files |
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
require "autotest/growl" | |
require "autotest/fsevent" | |
RSPEC=true |
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
begin | |
#do something... | |
raise Exception, "Error message" | |
raise ArgumentError | |
rescue Exception => e | |
puts e.message | |
rescue ArgumentError => e | |
puts e.message | |
ensure |
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
# Start/Stop PostgreSQL | |
If this is your first install, automatically load on login with: | |
mkdir -p ~/Library/LaunchAgents | |
cp /usr/local/Cellar/postgresql/9.1.3/homebrew.mxcl.postgresql.plist ~/Library/LaunchAgents/ | |
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist | |
If this is an upgrade and you already have the homebrew.mxcl.postgresql.plist loaded: | |
launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist | |
cp /usr/local/Cellar/postgresql/9.1.3/homebrew.mxcl.postgresql.plist ~/Library/LaunchAgents/ |
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
from:([email protected] OR [email protected] OR *@not.example.com) |
OlderNewer