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
func main() { | |
app := cli.NewApp() | |
app.Name = "cli" | |
app.Version = "0.0.1" | |
app.Usage = "Fight the lack of Go knowledge" | |
app.Commands = []cli.Command { | |
{ | |
Name: "web", | |
Aliases: []string{"s"}, | |
Usage: "Start the web server.", |
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
package main | |
import ( | |
"fmt" | |
"io/ioutil" | |
"encoding/json" | |
) | |
type Data struct { | |
Id string `json:"id"` |
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
UIScreen* mainScreen = [UIScreen mainScreen]; | |
CGRect frame = mainScreen.bounds; | |
MyUIView* view = [[MyUIView alloc] initWithFrame:frame]; | |
UIImage* background = [UIImage imageNamed:@"[email protected]"]; | |
UIImageView* bgView = [[UIImageView alloc] initWithImage:background]; | |
bgView.frame = frame; |
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
#!/bin/bash | |
mkdir -p dest/temp | |
sed -e ' | |
s/:before[ ]*{// | |
/^[^.]/d | |
/^$/d | |
' src/site/styles/style.css > dest/temp/icons.txt |
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
Oliver Queen Green Arrow | |
Alan Scott Green Lantern | |
Will Everett Amazing Man | |
Irwin Schwab Ambush Bug | |
Buddy Baker Animal Man | |
Arthur Curry Aquaman | |
Roy Harper Red Arrow | |
Ray Palmer Atom |
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" |
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
// 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
# 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
_.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') |