Skip to content

Instantly share code, notes, and snippets.

View johno's full-sized avatar
🖤
Computering

John Otander johno

🖤
Computering
View GitHub Profile
@johno
johno / glyphicon_script.sh
Created October 12, 2012 23:51
Glyphicons Cleanup
#!/bin/sh
# Arg 1 <path_to_dir/glyphicon_dir>
# Arg 2 <path_to_dir/new_glyphicon_dir>
#
# Requires ImageMagick
#
# This script takes the original glyphicon directory as arg1,
# Cleans up the names for a sprite sheet and places them into
# The specified directory from arg2. Then, it makes white and
@johno
johno / black_to_white_and_blue_icons.sh
Created October 25, 2012 15:50
The power of ImageMagick...
for file in $newdir/* ; do
convert $file -quantize GRAY -negate `echo $file | sed 's/.png/-white.png/'`
convert `echo $file | sed 's/.png/-white.png/'` -fuzz 70% -fill '#0398d6' -opaque white `echo $file | sed 's/.png/-blue.png/'`
done
@johno
johno / activity_request_spec.rb
Last active December 11, 2015 17:49
Template for model/request specs.
describe Activity do
let(:admin) { FactoryGirl.create :admin }
let(:user) { FactoryGirl.create :user, account: admin.account }
let(:other) { FactoryGirl.create :user } # Another account
let(:admin_activity) { FactoryGirl.create :activity, user: admin }
let(:user_activity) { FactoryGirl.create :activity, user: user }
let(:other_activity) { FactoryGirl.create :activity, user: other }
def will_toggle_function
<<-JS
$.fn.willToggleDiv = function(div) {
$(div).slideToggle(100)
.find('input')
.val(null);
}
JS
end
@johno
johno / HashTable.java
Last active December 15, 2015 05:19
I don't like Java very much.
import java.util.*;
import java.math.*;
public class HashTable {
private int tableSize;
private int debugLevel;
private BigInteger maxSize = new BigInteger("96000");
private BigInteger minSize = new BigInteger("95500");
@johno
johno / HashObject.c
Last active December 15, 2015 07:29
Linkie listies.
/*
* HashObject.c
*
* Created on: Apr 11, 2012
* Author: johnotander
*/
#include "HashObject.h"
@johno
johno / agree_to_terms.js.coffee
Created April 5, 2013 16:13
Becoming a fanboy.
$ ->
subscription.hijackSubmitBtn()
subscription.hijackAgreeToTermsLink()
subscription =
hijackSubmitBtn: ->
$('#new_subscription').submit ->
if $('#terms_checkbox').is(':checked')
true
else
@johno
johno / .zshrc
Created April 7, 2013 20:33
My current config.
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="johnotander"
# Example aliases
/*
*
*
* Created on: Feb 1, 2012
* Author: johnotander
*/
#include "TheTokens.h"
@johno
johno / confirm_guest_spec.rb
Last active December 17, 2015 06:59
Each of these are found in spec/mailers/accounts_mailer/
require 'spec_helper'
describe AccountsMailer do
let(:user) { FactoryGirl.create :user, account: GUEST_ACCOUNT }
describe "confirm_guest" do
it "shouldn't raise an error" do
lambda { AccountsMailer.confirm_guest(user) }.should_not raise_error