Skip to content

Instantly share code, notes, and snippets.

Working from home

Tiffany White twhite96

Working from home
Block or report user

Report or block twhite96

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
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-palindromes.js
// Bonfire: Check for Palindromes
// Author: @twhite96
// Challenge:!%0A%20%20%0A%20%20str%20%3D%20str.toLowerCase()%3B%0A%20%20%0A%20%20str%20%3D%20str.replace(%2F%5B%5Ea-z%7C1-9%5D%2Fg%2C%20%22%22)%3B%0A%20%20%0A%20%20if%20(str.length%20%3D%3D%3D%200)%7B%0A%20%20%20%20return%20true%3B%0A%20%20%7D%0A%20%20%0A%20%20if%20(str%5B0%5D%20!%3D%3D%20str%5Bstr.length-1%5D)%7B%0A%20%20%20%20return%20false%3B%0A%20%20%7D%0A%20%20%0A%20%20else%20%7B%0A%20%20%20%20return%20palindrome(str.slice(1%2Cstr.length%20-%201))%3B%0A%20%20%7D%0A%7D%0A%0A%0Apalindrome(%22eye%22)%3B%0A
// Learn to Code at Free Code Camp (
function palindrome(str) {
str = str.toLowerCase().replace(/[\W_]/g, '');
for(var i = 0, len = str.length - 1; i < len/2; i++) {
if(str[i] !== str[len-i]) {
return false;
You can’t perform that action at this time.