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
// ==UserScript==
// @name IRCButt Hide Sidebar
// @namespace http://userstyles.org
// @description Hides the sidebar. Hover on side to toggle visibility.
// @author ahtanu
// @homepage http://userstyles.org/styles/97987
// @include https://ircbutt.com*
// @include https://www.ircbutt.com*
// @include https://alpha.ircbutt.com*
// @run-at document-start
// ==UserScript==
// @name Terminal Theme for IRCButt [highlight mod]
// @namespace http://userstyles.org
// @description This theme started as modification of the wonderful Terminal Theme for IRCButt by kirbylover4000 (version 2.0), just to fix the bright red text highlighting.
// @author Specimen
// @homepage http://userstyles.org/styles/96192
// @include https://ircbutt.com/*
// @include https://www.ircbutt.com/*
// @include https://alpha.ircbutt.com/*
// @run-at document-start
// ==UserScript==
// @name Terminal Theme for IRCButt [highlight mod]
// @namespace http://userstyles.org
// @description This theme started as modification of the wonderful Terminal Theme for IRCButt by kirbylover4000 (version 2.0), just to fix the bright red text highlighting.
// @author Specimen
// @homepage http://userstyles.org/styles/96192
// @include https://ircbutt.com/*
// @include https://www.ircbutt.com/*
// @include https://alpha.ircbutt.com/*
// @run-at document-start
@evanwalsh
evanwalsh / gobs_program.rb
Created June 25, 2014 13:20
Gob's Program
puts "Gob's Program: Y/N?"
print "? "
answer = gets.chomp
if answer == "Y"
while true
print "Penus "
end
end
### Keybase proof
I hereby claim:
* I am evanwalsh on github.
* I am evanwalsh (https://keybase.io/evanwalsh) on keybase.
* I have a public key whose fingerprint is 17E6 2822 7D1A 3BE7 F61E 7968 25D3 BCFA BB9C 9810
To claim this, I am signing this object:
# A model for Ruby on Rails that gets settings from a DB
# And it caches them! Success!
class Preference < ActiveRecord::Base
def self.get(name)
return Rails.cache.fetch(name) {
output = self.find_by_name!(name)
Rails.cache.write(name,output.value)
}
# Put this in routes.rb at the very bottom (right before end)
map.error '*path', :controller => 'application', :action => 'rescue_404'
# Put this in application.rb
rescue_from ActiveRecord::RecordNotFound, ActionController::UnknownAction, :with => :rescue_404
def rescue_404
render :template => "errors/404", :layout => "application", :status => "404"
#!/bin/bash
# Let's get a git repo on a host that doesn't have it
curl -L http://github.com/$1/$2/tarball/master -o $1-$2.tar.gz > /dev/null
echo "Download of tarball complete."
tar -xf $1-$2.tar.gz > /dev/null
rm $1-$2.tar.gz
echo "Untarring of tarball complete."
echo "Feel free to change to the new dir"
# 1) Point *.example.com in your DNS setup to your server.
#
# 2) Setup an Apache vhost to catch the star pointer:
#
# <VirtualHost *:80>
# ServerName *.example.com
# </VirtualHost>
#
# 3) Set the current account from the subdomain
class ApplicationController < ActionController::Base
// C IS FOR COOKIE originally by Mislav Marohnić ( http://mislav.uniqpath.com/js/c-is-for-cookie/ )
// chopped and spliced by Evan Walsh
var Cookie = {
find: function(name){
var name = escape(name) + '='
if (document.cookie.indexOf(name) >= 0) {
var cookies = document.cookie.split(/\s*;\s*/)
for (var i = 0; i < cookies.length; i++) {
if (cookies[i].indexOf(name) == 0)
return unescape(cookies[i].substring(name.length, cookies[i].length))