Skip to content

Instantly share code, notes, and snippets.

Waiting for code to compile

Tiffany White twhite96

Waiting for code to compile
View GitHub Profile
View example.js
// `this` is an anchor DOM element in this context
// but it's not wrapped in a jQuery wrapper and doesn't
// have access to any of jQuery's helper methods.
var $a = $(this);
// once you wrap it in jQuery, it has access to them,
// for example to `.attr()`, `.prop()`, `.val()`, etc.
console.log('Clicked on', $a.attr('href'));
twhite96 /
Last active Aug 29, 2015 — forked from wzpan/
Java keyboard IO.
class HelloWorld
public static void main(String args[])
InputStreamReader sin = new InputStreamReader(;
BufferedReader br = new BufferedReader(sin);
System.out.println("Type your name: ");
View gist:a8db44388a63d9da738b
.module('angular-legacy-url', [])
.factory('AngularLegacyUrl', ['$window', function AngularLegacyUrlFactory($window) {
var getQueries = function (search) {
return search
.replace(/(^\?)/, '')
.reduce(function (sum, item) {
if ( item === '' ) {
return sum;
View Ruby Monday 6-8
# put this in your .bash_profile
if [ $ITERM_SESSION_ID ]; then
export PROMPT_COMMAND='echo -ne "\033];${PWD##*/}\007"; ':"$PROMPT_COMMAND";
# Piece-by-Piece Explanation:
# the if condition makes sure we only screw with $PROMPT_COMMAND if we're in an iTerm environment
# iTerm happens to give each session a unique $ITERM_SESSION_ID we can use, $ITERM_PROFILE is an option too
# the $PROMPT_COMMAND environment variable is executed every time a command is run
# see:

Deploying Yeoman apps to Heroku


This assumes you already have a Yeoman app and are ready for publishing

Build for Production

Create production directory & assets

twhite96 / gist:ec30aa07a1a039ef3927
Created Sep 23, 2015 — forked from lupeke/gist:6233678
Google Contacts API v3 Javascript sample
View gist:ec30aa07a1a039ef3927
<script src=""></script>
<script src=""></script>
function auth() {
var config = {
'client_id': 'OAUTH_CLIENT_ID',
'scope': ''
View bonfire-reverse-a-string?solution=function%20reverseString(str)%20%7B%0A%20%20str%20%3D%20str.split(%27%27)%3B%0A%20%20str%20%3D%20str.reverse()%3B%0A%20%20str%20%3D%20str.join(%27%27)%3B%0A%20%20return%20str%3B%0A%7D%0A%0A%0A%0A%0A%0AreverseString(%
// Bonfire: Reverse a String
// Author: @twhite96
// Challenge:
// Learn to Code at Free Code Camp (
function reverseString(str) {
str = str.split('');
str = str.reverse();
str = str.join('');
return str;
View bonfire-factorialize-a-number?solution=function%20factorialize(num)%20%7B%0A%20%20if%20(num%20%3D%3D%3D%200)%20%7B%0A%20%20%20%20return%201%3B%0A%20%20%7D%0A%20%20%20%20return%20num%20*%20factorialize(num%20-%201)%3B%0A%7D%0A%0Afactorialize(5)%3B%0A.
// Bonfire: Factorialize a Number
// Author: @twhite96
// Challenge:*%20factorialize(num%20-%201)%3B%0A%7D%0A%0Afactorialize(5)%3B%0A
// Learn to Code at Free Code Camp (
function factorialize(num) {
if (num === 0) {
return 1;
return num * factorialize(num - 1);
View bonfire-find-the-longest-word-in-a-string?solution=function%20findLongestWord(str)%20%7B%0A%20%20var%20words%20%3D%20str.split(%27%20%27)%3B%0A%20%0A%20%20var%20longest%20%3D%200%3B%0A%20%20%0A%20%20for%20(var%20i%20%3D%200%3B%20i%20%3C%20words.lengt
// Bonfire: Find the Longest Word in a String
// Author: @twhite96
// Challenge:
// Learn to Code at Free Code Camp (
function findLongestWord(str) {
var words = str.split(' ');
var longest = 0;