Skip to content

Instantly share code, notes, and snippets.

Avatar
😅
Being good to others

Evan Walsh evanwalsh

😅
Being good to others
View GitHub Profile
View irccloud-hide-sidebar.js
// ==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
View irccloud-dark-matter-reloaded-reloaded.js
// ==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
View styleupdated.js
// ==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
View gobs_program.rb
puts "Gob's Program: Y/N?"
print "? "
answer = gets.chomp
if answer == "Y"
while true
print "Penus "
end
end
View gist:d7caa03ae16d2f1f3031
### 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:
View setting.rb
# 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)
}
View rescue_404.rb
# 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"
View get-git.sh
#!/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"
View gist:44426
# 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
View gist:105824
// 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))