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
def test_me | |
puts test_me | |
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
#This is the path variable for my current projects path. It changes as I change projects. | |
export CPPATH=~/code/rails/rwp | |
# Adds Macports and Git to PATH & MANPATH. | |
export MANPATH=/opt/local/share/man:$MANPATH | |
export PATH=/usr/local/git/bin:/opt/local/bin:/opt/local/sbin:$PATH | |
#Sets SVN, GVS and default editors to Textmate | |
export EDITOR="mate -w" | |
export CVSEDITOR="mate -w" |
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 'pp' | |
require 'logger' | |
#Load Wribble (colouring etc in irb) | |
begin | |
require 'wirble' | |
Wirble.init | |
Wirble.colorize |
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
set value to the name of (info for (path to frontmost application)) | |
if value contains "." then | |
repeat until last character of value = "." | |
set total to count (character of value) | |
set value to characters 1 through (total - 1) of value as text | |
end repeat | |
set total to count (character of value) | |
set value to characters 1 through (total - 1) of value as text | |
end if | |
return value |
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
<img src="${1:http://dummyimage.com/${2:250x400}/${3:555555}/${4:ffffff}.${5:png}${7:&text=${6:placeholder+image}}}" alt="${8:Placeholder Image}" /> |
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
include Math | |
def myPi(reps) | |
inside = 0 | |
reps.times do | |
inside += 1 if (Math.sqrt(rand**2+rand**2) < 1) | |
end | |
return (4*inside)/reps.to_f | |
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
class Person | |
attr_accessor :name, :height, :hair_color, :fatness | |
def initialize(name, height, hair, fatness) | |
self.name = name.capitalize | |
self.height = height.to_f | |
self.hair_color = hair.capitalize | |
self.fatness = fatness | |
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
loop do | |
print ">>" | |
output = eval($stdin.gets) | |
print "=>" | |
puts output.inspect | |
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
#Includes circle.rb in this file. | |
#require File.join(File.dirname(__FILE__), 'circle.rb') | |
require 'yaml' | |
#Prints the contents of the data part of the file. | |
a = DATA.readlines | |
b = YAML::load(DATA) | |
puts "-----" |
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
<!DOCTYPE html> | |
<!-- Helpful things to keep in your <head/> | |
// Brian Blakely, 360i | |
// http://twitter.com/brianblakely/ | |
--> | |
<head> | |
<!-- According to Heather Champ, former community manager at flickr, | |
you should not allow search engines to index your "Contact Us" |
OlderNewer