This assumes you already have a Yeoman app and are ready for publishing
Create production directory & assets
$('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')); | |
}); |
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{ |
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 | |
# 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 |
This assumes you already have a Yeoman app and are ready for publishing
Create production directory & assets
<html> | |
<head> | |
<script src="https://apis.google.com/js/client.js"></script> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script> | |
<script> | |
function auth() { | |
var config = { | |
'client_id': 'OAUTH_CLIENT_ID', | |
'scope': 'https://www.google.com/m8/feeds' | |
}; |
// Bonfire: Reverse a String | |
// Author: @twhite96 | |
// Challenge: http://www.freecodecamp.com/challenges/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(%22hello%22)%3B%0A | |
// Learn to Code at Free Code Camp (www.freecodecamp.com) | |
function reverseString(str) { | |
str = str.split(''); | |
str = str.reverse(); | |
str = str.join(''); | |
return str; |
// Bonfire: Factorialize a Number | |
// Author: @twhite96 | |
// Challenge: http://www.freecodecamp.com/challenges/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 | |
// Learn to Code at Free Code Camp (www.freecodecamp.com) | |
function factorialize(num) { | |
if (num === 0) { | |
return 1; | |
} | |
return num * factorialize(num - 1); |
// Bonfire: Find the Longest Word in a String | |
// Author: @twhite96 | |
// Challenge: http://www.freecodecamp.com/challenges/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.length%3B%20i%2B%2B)%20%7B%0A%20%20%20%20if%20(words%5Bi%5D.length%20%3E%20longest)%20%7B%0A%20%20%20%20%20%20longest%20%3D%20words%5Bi%5D.length%3B%0A%20%20%20%20%7D%0A%20%20%20%20%0A%20%20%7D%0A%20%20%0A%20%20%20%20%20%20return%20longest%3B%0A%7D%0A%0AfindLongestWord(%22The%20quick%20brown%20fox%20jumped%20over%20the%20lazy%20dog%22)%3B%0A | |
// Learn to Code at Free Code Camp (www.freecodecamp.com) | |
function findLongestWord(str) { | |
var words = str.split(' '); | |
var longest = 0; | |