Discover gists
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
<strong>Hello world</strong> |
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
val SEED = 23 | |
def hash(seed: Int, value: Boolean): Int = firstTerm(seed) + (if (value) 1 else 0) | |
def hash(seed: Int, value: Char): Int = firstTerm(seed) + value.asInstanceOf[Int] | |
def hash(seed: Int, value: Int): Int = firstTerm(seed) + value | |
def hash(seed: Int, value: Long): Int = firstTerm(seed) + (value ^ (value >>> 32) ).asInstanceOf[Int] | |
def hash(seed: Int, value: Float): Int = hash(seed, JFloat.floatToIntBits(value)) | |
def hash(seed: Int, value: Double): Int = hash(seed, JDouble.doubleToLongBits(value)) | |
def hash(seed: Int, anyRef: AnyRef): Int = { | |
var result = seed |
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
BODY { | |
background-position: 0 49.9% /* Top and Center */ | |
} |
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
http://www.boingboing.net/2008/07/15/chinese-restaurant-c.html |
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
test |
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
#!/usr/bin/env ruby | |
# Ruby script to automatically "git rm" deleted files | |
DELETED_REXP = /^#\s+deleted:\s+(.*)/ | |
MARKER_LINE = '# Changed but not updated:' | |
lines = `git status` | |
found_marker = false |
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 UserObserver < ActiveRecord::Observer | |
def after_create(user) | |
UserMailer.deliver_signup_notification(user) | |
end | |
def after_save(user) | |
UserMailer.deliver_activation(user) if user.recently_activated? | |
UserMailer.deliver_forgot_password(user) if user.recently_forgot_password? | |
UserMailer.deliver_reset_password(user) if user.recently_reset_password? |
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 UserObserver < ActiveRecord::Observer | |
def after_create(user) | |
UserMailer.deliver_signup_notification(user) | |
end | |
def after_save(user) | |
UserMailer.deliver_activation(user) if user.recently_activated? | |
UserMailer.deliver_forgot_password(user) if user.recently_forgot_password? | |
UserMailer.deliver_reset_password(user) if user.recently_reset_password? |
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
Love this. | |
How do I tell it that I want this to be ruby? |
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 | |
$handle = fopen('file.csv', 'r'); | |
while ($a=fgetcsv($handle)) { | |
$b[] = $a; | |
} | |
echo "<table border='1'>"; | |
foreach ($b as $v) { | |
echo "<tr>"; |