Skip to content

Instantly share code, notes, and snippets.

Waiting for code to compile

T 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 / Codecademy jQuery section 12
Created May 30, 2015
Codecademy jQuery section 12/14
View Codecademy jQuery section 12
$(document).ready(function() {
$('#button').click(function() {
var toAdd = $('input[name=checkListItem]').val();
$(".list").append('<div class="item">' + toAdd + '</div>');
The HTML document has a form element with one text input control, The nameattribute value on the input tag is checkListItem. In addition to the form element, there is an element with id attribute value, button. This is the object that gets a binding to the click event listener.
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
twhite96 / rock-paper-scissors
Created Jun 16, 2015
Rock, Paper, Scissors Codecademy, to play with later
View rock-paper-scissors
var userChoice = prompt("Do you choose rock, paper or scissors?");
var computerChoice = Math.random();
if (computerChoice < 0.34) {
computerChoice = "rock";
} else if(computerChoice <= 0.67) {
computerChoice = "paper";
} else {
computerChoice = "scissors";
} console.log("Computer: " + computerChoice);
twhite96 / About.html
Last active Aug 29, 2015
View About.html
<!DOCTYPE html>
<head lang="en">
<meta charset="UTF-8">
<title>About Me</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.css" />
<link rel="stylesheet" href="styles/main.css">
# 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