View flow.txt
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8" /> | |
| <title>Battlefy</title> | |
| </head> | |
| <body> | |
| <div id="react-entry"> | |
| </div> | |
| <script type="text/javascript" src="bundle.js" charset="utf-8"></script> |
View less-nested.js
| const getUserByEmail = (connection, userEmail) => { | |
| const userPromise = connection | |
| .queryAsync(‘SELECT `id` FROM `user` WHERE `email` = ?’, [ | |
| userEmail | |
| ]) | |
| .then(R.head); | |
| const permissionsPromise = userPromise | |
| .then(R.unless(R.isNil, (user) => connection | |
| .queryAsync(‘SELECT `id`, `name` FROM `permission` WHERE `user_id` = ?’, [ |
View .profile
| RIGINAL_PATH='/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin' | |
| source `brew --prefix git`/etc/bash_completion.d/git-prompt.sh | |
| source `brew --prefix git`/etc/bash_completion.d/git-completion.bash | |
| export JAVA_HOME=`/usr/libexec/java_home` | |
| export MAVEN_HOME='/usr/local/opt/maven/libexec/' | |
| export PATH="$ORIGINAL_PATH:/Users/rchen/dev/tools/bin" |
View ts
| #!/bin/bash | |
| DATECMD='gdate +%s%N' | |
| process_stdout() { | |
| while read line; do | |
| echo -e `$DATECMD`"\t$line" | |
| done | |
| } |
View hlight
| #!/bin/bash | |
| grep --color "$1\|\$" - |
View maven-settings-decoder
| #!/usr/bin/env bash | |
| ############################################################################## | |
| ## | |
| ## maven-settings-decoder start up script for UN*X | |
| ## | |
| ############################################################################## | |
| # Add default JVM options here. You can also use JAVA_OPTS and MAVEN_SETTINGS_DECODER_OPTS to pass JVM options to this script. | |
| DEFAULT_JVM_OPTS="" |
View bug.groovy
| @Grab("org.spockframework:spock-core:0.7-groovy-2.0") | |
| import spock.lang.Specification | |
| class BuggedTest extends Specification { | |
| def thing = [] | |
| def "repo the bug"() { | |
| given: |
View functions.js
| function map() { | |
| emit(1, { | |
| sum: this.value, // the field you want stats for | |
| min: this.value, | |
| max: this.value, | |
| count: 1, | |
| diff: 0 | |
| }); | |
| } |
View bug.html
| <!doctype html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <script src="snap.svg.js"></script> | |
| </head> | |
| <body> | |
| <svg id="main" xmlns="http://www.w3.org/2000/svg" version="1.1" height=100%> | |
| </svg> | |
| <script> |
View cpwd
| #!/bin/bash | |
| nicepwd=`pwd | sed "s|$HOME|~|"`; | |
| # count the number of slashes in pwd | |
| slashes=`pwd | perl -pe 's/[^\/]//g' | wc -m` | |
| if [ $slashes -le 2 ]; then | |
| echo "$nicepwd"; | |
| else |
NewerOlder