Skip to content

Instantly share code, notes, and snippets.

View evanwalsh's full-sized avatar
❤️‍🔥
You make me feel almost human

Evan Walsh evanwalsh

❤️‍🔥
You make me feel almost human
View GitHub Profile
source :rubygems
gem 'rails', '~> 3.0.7'
# Database
gem 'mongoid', '~> 2.0.1'
gem 'bson_ext', '~> 1.3.0'
gem 'mongo_ext', '~> 0.19.3'
# Backend
// REQUIRED VARS. Defaults to a 950px wide, 24-column grid that has 30px wide units and 10px wide
// gutters. If you do the fluid grid, then this 950/24/30/10px size will become the maximum size.
$grid_type: fixed !default
$grid_columns: 24 !default
$grid_column_width: 30 !default
$grid_gutter_width: 10 !default
// GENERATED VARS. You can ignore these.
$grid_full_width: $grid_columns * $grid_column_width + $grid_columns * $grid_gutter_width - $grid_gutter_width
$grid_column_width_percent: ($grid_column_width / $grid_full_width * 100) * 1%
if __FILE__ == $0
puts "Run with: watchr #{__FILE__}. \n\nRequired gems: watchr rev"
exit 1
end
# --------------------------------------------------
# Convenience Methods
# --------------------------------------------------
def run(cmd)
puts(cmd)
@evanwalsh
evanwalsh / generate_salt.rb
Created January 24, 2011 21:13
A function I wrote. Don't know if I'll ever need it.
def generate_salt(length)
salt = String.new
32.times { salt += Kernel.rand(9999).to_s }
if salt.length > length
salt[0, length.to_i]
else
salt
end
end
$.noConflict();
jQuery(document).ready(function($){
$('.audio').each(function(){
var match = $(this).find('script').html().match(/audio_file=(.*)\\x26/);
$(this).find('span').html('<audio src="'+match[1]+'?plead=please-dont-download-this-or-our-lawyers-wont-let-us-host-audio" controls="controls">Your browser does not support the audio element.</audio>').remove();
$(this).find('script').remove();
});
});
@evanwalsh
evanwalsh / template.rb
Created October 23, 2010 20:36
My personal template for my Rails projects
# Evan Walsh Rails template - version 3
@after_blocks = []
def after_bundler(&block); @after_blocks << block; end
def say_wizard(text); say "\033[36m" + "wizard".rjust(10) + "\033[0m" + " #{text}" end
# Remove some junk I don't need
inside('public') do
FileUtils.rm_rf %w(index.html 404.html 422.html 500.html favicon.ico)
> #kill-defaults
g http://www.google.com/search?q=%s Google Search
m http://www.google.com/maps?q=%s Google Maps
i http://www.google.com/images?q=%s Google Image Search
tr http://translate.google.com/translate?u=%r&tl=%s Translate the current page
w http://wikipedia.org/wiki/Special:Search/%s Wikipedia Search
a http://amazon.com/s/?url=search-alias%3Daps&field-keywords=%s Amazon Search
imdb http://www.imdb.com/find?s=all&q=%s IMDB Search
nf http://www.netflix.com/Search?v1=%s Netflix Search
f http://flickr.com/search/?q=%s Flickr Search
Globalism is a great idea. However, it's all in the execution. Connecting the world is a wonderful deed (and I hope to see it done soon), but I fear that we will lose our "cottage industry", so to speak. I want the world to be unified for the betterment of man, but I don't want to lose the friendly service and the connection to local businesses. Therefore, I cannot fully say that I support globalization.
Human rights will definitely be (and already is) an issue. When outsourcing work to places with less stringent labor laws, companies are probably tempted to cut costs by cutting workplace rights. The only solution I can see is either some sort of global sanction against worker exploitation or consumers demanding moral business operations. Losing money during the labor process may be upsetting for companies, but losing money due to lack of sales will upset much more. Therefore, the businesses and the consumers are equally responsible.
National security is an issue, but I am not overly concerned. I
# = YERB
#
# Who needs HAML when you have YAML + ERB? :)
#
# See example.yaml below for an example. You can run this code
# by cloning this gist and then `ruby _yerb.rb example.yaml`.
#
# Notice that you need Ruby 1.9 so the hash order is preserved.
# Obviously, this is just for fun. Definitely slow as hell.
#
Evan Walsh
Mr. Bolser
AP Art History
29 January 2010
Giotto di Bondone
The man who may have started the Italian Renaissance was not born in Florence. He was born in Vespignano in 1267. However, this was close enough to Florence that he came to impact the area eventually.
Proclaimed later as the “first genius” of the Italian Renaissance, he wasn’t always the famous artist. His father was a small-time farmer and Giotto (as he was commonly referred to) helped out around the farm. One theory says that the start of the great artist came about as Giotto was sketching on a flat rock a picture of his father’s sheep one day. Cimabue, a well-known painter at the time, happened to come upon Giotto in his travels. He was so impressed with the young boy’s skill, he took him on as his pupil. Another possibly story is that Giotto frequented Cimabue’s studio so much that he was eventually allowed to study painting underneath the famed painter.
Regardless of his origins, he went on to complete one of his earliest works: