Skip to content

Instantly share code, notes, and snippets.

View raws's full-sized avatar
🥯
dabbling in pumpernickel

Ross Paffett raws

🥯
dabbling in pumpernickel
View GitHub Profile
var str = "filters[0]['name']";
str.replace("0", "1");
console.log(str); #=> "filters[1]['name']
<html>
<body>
<h1><%= content_for :title %></h1>
<div id="article">
<%= content_for :article %>
</div>
</body>
</html>
require 'eventmachine'
require 'tkellem/irc_line'
require 'tkellem/client'
module Tkellem
module BouncerConnection
include EM::Protocols::LineText2
include Tkellem::EasyLogger
<eirik> minecraft is a freudian exercise
<eirik> every consecutive block removed in minecraft is a manifested yearning for one's mother's vagina
<eirik> every block stacked, a monument to your father's erection
$ ruby -vKU nick_matching.rb
ruby 1.8.7 (2010-12-23 patchlevel 330) [i686-darwin10.6.0]
Matching against /^\w[\w-]{0,15}$/u
"" nil
"-" nil
"foo bar" nil
"sam" #<MatchData "sam">
"⌘lee" #<MatchData "⌘lee">
"I♥" #<MatchData "I♥">
function chkIsNum(oStr) {
var nStr = new String(oStr)
nStr = nStr.replace(/[^0-9]/g, '')
if (nStr != oStr) {
alert("You have entered a non-numeric character in a quantity field.")
return 1
} else {
return 0
}
}
body {
margin: 0;
}
#wrapper {
width: 1000px;
margin: 0 auto;
}
5.times do
print "I am a giant bucket"
end
class Menu < ActiveRecord::Base
attr_writer :items
has_many :menu_items
def items
@items ||= []
end
end
<div id="nav">
<div class="left">
<a href="/images/screenshots/">...</a>
</div>
<div class="right">
<a href="http://twitter.com/limbero">...</a>
<a href="http://last.fm/user/limbero">...</a>
</div>
</div>