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
$('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
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>');
});
});
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 Aug 29, 2015 — forked from wzpan/HelloWorld.java
Java keyboard IO.
View HelloWorld.java
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{
View gist:a8db44388a63d9da738b
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;
View Ruby Monday 6-8
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 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
twhite96 / About.html
Last active Aug 29, 2015
address-book
View About.html
<!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>
View current-dir-in-iterm-tab-title.sh
# 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
View 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

You can’t perform that action at this time.