Skip to content

Instantly share code, notes, and snippets.

View twhite96's full-sized avatar
☢️
Cookin

tiff twhite96

☢️
Cookin
View GitHub Profile
@twhite96
twhite96 / example.js
Last active August 29, 2015 14:22 — forked from airportyh/example.js
$('a.link').click(function(){
// `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
twhite96 / Codecademy jQuery section 12
Created May 30, 2015 07:32
Codecademy jQuery section 12/14
$(document).ready(function() {
$('#button').click(function() {
var toAdd = $('input[name=checkListItem]').val();
$(".list").append('<div class="item">' + toAdd + '</div>');
});
});
Explanation:
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
twhite96 / HelloWorld.java
Last active August 29, 2015 14:22 — forked from wzpan/HelloWorld.java
Java keyboard IO.
import java.io.*;
class HelloWorld
{
public static void main(String args[])
{
InputStreamReader sin = new InputStreamReader(System.in);
BufferedReader br = new BufferedReader(sin);
System.out.println("Type your name: ");
try{
@twhite96
twhite96 / gist:a8db44388a63d9da738b
Last active August 29, 2015 14:22 — forked from oogatta/gist:3fcd96a6e7701bf60080
angular legacy url
angular
.module('angular-legacy-url', [])
.factory('AngularLegacyUrl', ['$window', function AngularLegacyUrlFactory($window) {
var getQueries = function (search) {
return search
.replace(/(^\?)/, '')
.split('&')
.reduce(function (sum, item) {
if ( item === '' ) {
return sum;
https://gemma.herokuapp.com/
https://github.com/freerange/mocha
http://www.meetup.com/OKC-Ruby/
http://www.codenewbie.org/blogs/object-oriented-programming-vs-functional-programming
http://phoenix.thefirehoseproject.com/0.html
@twhite96
twhite96 / rock-paper-scissors
Created June 16, 2015 03:08
Rock, Paper, Scissors Codecademy, to play with later
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
twhite96 / About.html
Last active August 29, 2015 14:24
address-book
<!DOCTYPE html>
<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">
</head>
# put this in your .bash_profile
if [ $ITERM_SESSION_ID ]; then
export PROMPT_COMMAND='echo -ne "\033];${PWD##*/}\007"; ':"$PROMPT_COMMAND";
fi
# 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: ss64.com/bash/syntax-prompt.html
@twhite96
twhite96 / README.md
Last active August 29, 2015 14:24 — forked from micjamking/README.md

Deploying Yeoman apps to Heroku

Prerequisites

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

Build for Production

Create production directory & assets