Skip to content

Instantly share code, notes, and snippets.

View trevmex's full-sized avatar
πŸ‘¨β€πŸ‘©β€πŸ‘§β€πŸ‘¦

Trevor Menagh trevmex

πŸ‘¨β€πŸ‘©β€πŸ‘§β€πŸ‘¦
View GitHub Profile
// ==UserScript==
// @name Hide Unnessary Campfire Messages
// @namespace http://www.trevmex.com
// @description Hide everything but text messsages.
// @author Trevor Lalish-Menagh
// @homepage
// @include http*//*.campfirenow.com/room*
// ==/UserScript==
(function($) {
@trevmex
trevmex / bst.js
Created February 11, 2011 05:38
A simple binary search tree in JavaScript
/*
* File: bst.js
*
* A pure JavaScript implementation of a binary search tree.
*
*/
/*
* Class: BST
*
@trevmex
trevmex / gist:965022
Created May 10, 2011 18:12
JavaScript template to make private functions testable
if (typeof NS === 'undefined' || !NS) {
var NS = {};
}
(function ($) {
NS.Klass = function(options) {
var settings = {
debug: false
},
private = {
@trevmex
trevmex / gist:981210
Created May 19, 2011 16:48
intelligent discussion about gender issue in #railsconf
[11:53am] Dreamer3: More women this year than last
[11:53am] jumex: 2.5% of the conference!
[11:54am] Dreamer3: I need to find a career where men are in the minority
[11:54am] jumex: Hopefully more next year. We NEED more women in tech!
[11:55am] necromancer: they should call that movement to try and get more females into programming "boner-driven development"
[11:55am] mike-burns: Discussion gender in tech is tricky because someone always says a negatively-sexist remark within five minutes.
[11:56am] necromancer: mike-burns: do you think the fact that men outnumber women in tech is itself sexist?
[11:56am] necromancer: or merely a product of how men & women are handled in this country?
[11:56am] jumex: We are all sexists, but we have to realize it before we can control it.
[11:57am] jumex: mike-burns: I totally agree with you there.
@trevmex
trevmex / jp.yml
Created May 25, 2011 13:19
Japanese locale for formtastic
jp:
formtastic:
:yes: 'はい'
:no: 'γ„γ„γˆ'
:create: '%{model}γ‚’δ½œγ‚‹'
:update: '%{model}γ‚’γ‚’γƒƒγƒ—γƒ‡γƒΌγƒˆγ™γ‚‹'
:submit: '%{model}γ‚’γ‚΅γƒ–γƒŸγƒƒγƒˆγ™γ‚‹'
:required: '必要'
/ Why Can't I Test My JavaScript?
%h3 #railsconf 2011 Notes
%i Greg Moeck (gregmoeck)
%p The Ruby community has made TDD/BDD accessible.
%p Why can't we do TDD/BDD inJavaScript?
%p What is the problem? There are LOTS of excuses:
%ul
%li The tools suck
%li The browser sucks
%li The DOM sucks
@trevmex
trevmex / jasmine.nested_spies.spec.js
Created June 28, 2011 15:42
Nesiting spies to see if a callback in a deep nest has worked.
function nestedCallbacks(callback) {
console.log("start");
firstNest(function () {
secondNest(function () {
callback("test");
});
});
}
function firstNest(callback) {
@trevmex
trevmex / .screenrc
Created June 29, 2011 13:06
My Screen config
#----------
# jumex's .screenrc config file
# Make the bell visible instead of audible
vbell on
vbell_msg "Ding"
vbellwait 0
# Shut off the startup message
startup_message off
@trevmex
trevmex / .bashrc
Created July 6, 2011 23:21
Adding git and svn info to the prompt
function parse_git_dirty {
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*"
}
function parse_git_branch {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
echo " ("${ref#refs/heads/}$(parse_git_dirty)")"
}
function parse_svn_repo {
@trevmex
trevmex / footer.html
Created August 7, 2011 19:34
This is an iFrame Helper that adds a function called reloadIframesOnClick which reloads all the sibling iFrames on a page that share a domain on a click event.