This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void start() { | |
started = true; | |
System.out.print("\u001b[31m"); | |
System.out.print(Joiner.on(", ").join("Hello", "World")); | |
System.out.print("\u001b[39m"); | |
System.out.println(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("div.content").on("click", function(ev) { | |
var s = [] | |
var e = $(this) | |
if (e.is(".content")) { | |
e.find(".frame > div") | |
.each(function(i,e) { | |
var rgb = $(e).css("background-color") | |
.match(/([0-9]+)/g, ',') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
key = "some key" | |
key.substring(0, key.length -1) # <= Produces length is not a function Hahaha | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.json = (args...) -> | |
console.log.apply(console, _.map(args, (a) -> JSON.stringify(a, null, ' '))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_.mixin | |
# Better than random number, this should not allow for collisions. | |
# Code was minimally modified from | |
# [stackoverflow](http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript), | |
# demonstrated at [jsfiddle](http://jsfiddle.net/briguy37/2MVFd/) | |
uuid : -> | |
now = Date.now() | |
'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace /[xy]/g, (c) -> | |
r = (now + Math.random() * 16) % 16 | 0 | |
now = Math.floor now / 16 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_.mixin | |
### | |
Turns an array of values into an associated object where the keys are | |
properties found on items of the array. For instance, turning a list of | |
users into a map of IDs to the Person. | |
Examples: | |
# Simple/typical usage | |
lookup = _.toLookup(items, 'property') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Ignore everything in this directory | |
* | |
# Except this file | |
!.gitignore |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Additional references: http://ionicframework.com/blog/angularjs-console/ | |
// Get the scope of the element selected under the Chrome developer tool tab | |
c = angular.element($0).scope() | |
// Get the 'MyService' from the angular injector | |
angular.element(document.body).injector().get('MyService') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This one-liner commits a change from another local dir to the current repo. | |
# It uses a patch file to export the change and the does a 3 way commit. | |
# Found here: http://stackoverflow.com/questions/5120038/is-it-possible-to-cherry-pick-a-commit-from-another-git-repository | |
$ git --git-dir=../some_other_repo/.git \ | |
format-patch -k -1 --stdout <commit SHA> | \ | |
git am -3 -k |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
yargs = require 'yargs' | |
args = yargs | |
.options( | |
t: | |
alias: "tstuff" | |
description: "Does t stuff" | |
b: | |
alias: "batman" |
OlderNewer