Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js">
</script>
<script>
$(document).ready(function(){
$("#target").blur(function(){
var name = $("#target").val();
@seanrclayton
seanrclayton / gist:9810836
Created March 27, 2014 15:57
rails snippet
<%= form_tag("#", method: "get") do %>
<legend> Your Name?</legend>
<%= text_field_tag(:name) %> <br>
<span id="myspan" style="display: block;"> <legend> Guests / Child's name?</legend> <input name ="guest[name][]" type="text" ></span>
<br><br>
<%= submit_tag("That should do it") %>
<%end%>
require 'pp'
def mtab_look
mtab_filepaths = []
mtab = File.open("/etc/mtab", 'r').read
mtab.split("\n").each do |x|
unless x.match(/.\z/).to_s.include?("0")
mtab_filepaths << x.match(/\/\S*/).to_s
end
end
#!/usr/bin/ruby
require 'pp'
def mtab_look
mtab_filepaths = []
mtab = File.open("/etc/mtab", 'r').read
mtab.split("\n").each do |x|
unless x.match(/.\z/).to_s.include?("0")
mtab_filepaths << x.match(/\/\S*/).to_s
(1..100).each do |x|
if x % 3 == 0 && x % 5 == 0
puts "Fizzbuzz"
elsif x % 3 == 0
puts "fizz"
elsif x % 5 == 0
puts "buzz"
@player_win_count = 0
@op_win_count = 0
def game
choices = ['rock', 'paper', 'scissors' ]
@seanrclayton
seanrclayton / gist:10936193
Created April 16, 2014 21:43
loop through hash
def iterate_hash(hash, i_want)
@i_want = i_want
hash.each_pair do |k,v|
if k == i_want
puts "#{k} is the fucking key"
puts "#{v} is the fucking value"
end
if v.is_a?(Hash)
iterate_hash(v, @i_want)
end
require 'pp'
instances = "bags bread shit blah"
in_scope = ["cookies", "salad", "bags"]
if in_scope.find {|e| /#{e}/ =~ instances }
print "happy day"
else
print "I'm sad"
<head>
<script>
$(document).ready(function(){
array = ['image1.png','image2.png','image3.png']
i = 0
activeimage = array[0]
$('#slideshow').find('img').attr("src", "/"activeimage);
});
Ian Schumann
10:48 actually this was when we were planning our Registry inventory. pretty funny. we came from such different starting points about what kinds of things you should have in life and that conflict revealed the deeper issues at hand
Sean Clayton
10:48 yes
10:48 steph and i have had that exact fight
10:48 and i went
10:48 WELLP how much do i care about this to make it an issue
10:48 not enough.
Ian Schumann