This file contains 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 | |
set -o errexit # Exit on error | |
set -o nounset # Treat unset variables as an error | |
set -o pipefail # Consider errors in a pipeline | |
default_editor=${EDITOR:-vim} | |
temp_file_path=$(mktemp /tmp/clip_temp.XXXXXX) | |
trap "rm -f $temp_file_path" EXIT |
This file contains 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
function run() { | |
groupByColumn(0); | |
groupByColumn(1); | |
groupByColumn(2); | |
} | |
function selectRows(sheet, startRow, endRow) { | |
let numRows = endRow - startRow; | |
let startRow1Indexed = startRow + 2; | |
return sheet.getRange(startRow1Indexed, 1, numRows, sheet.getDataRange().getNumColumns()); |
This file contains 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
const _ = require("underscore"); | |
const fs = require("fs"); | |
// convert hex to base64 | |
function challenge1(hex) { | |
return Buffer.from(hex, "hex").toString("base64"); | |
} | |
// xor two hex encoded strings, return hex | |
function challenge2(hex1, hex2) { |
This file contains 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
[ | |
{ | |
"name":"Pavel", | |
"surname":"Gherghel", | |
"gender":"male", | |
"region":"Romania" | |
}, | |
{ | |
"name":"Ludmila", | |
"surname":"Găină", |
This file contains 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
aws.cloudwatch.api.us-east-1b.HTTPCode_Backend_2XX.count | |
aws.cloudwatch.api.*.HTTPCode_Backend_2XX.count | |
sumSeries(aws.cloudwatch.api.*.HTTPCode_Backend_2XX.count) | |
timeShift(sumSeries(aws.cloudwatch.api.*.HTTPCode_Backend_2XX.count), '-1w') | |
diffSeries(timeShift(sumSeries(aws.cloudwatch.api.*.HTTPCode_Backend_2XX.count), '-1w'), sumSeries(aws.cloudwatch.api.*.HTTPCode_Backend_2XX.count)) |
This file contains 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
# Basic compilation rules for CoffeScript | |
run: script.js | |
node script.js | |
clean: | |
rm script.js | |
.coffee.js : | |
coffee -c $< |
This file contains 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
import java.io.IOException; | |
import java.io.InputStream; | |
import java.io.StringWriter; | |
import java.net.HttpURLConnection; | |
import java.net.MalformedURLException; | |
import java.net.URL; | |
import oauth.signpost.OAuthConsumer; | |
import oauth.signpost.basic.DefaultOAuthConsumer; | |
import oauth.signpost.exception.OAuthCommunicationException; |
This file contains 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
<!DOCTYPE> | |
<!-- Designed by Peter Vidani | |
Found at http://www.tumblr.com/theme/467 | |
--> | |
<html lang="en"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
<meta name="generator" content="TextMate http://macromates.com/"> |
This file contains 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
#!/usr/bin/env python | |
'''I saw an Erlang solution to this problem, thought I'd give it a shot in Python. | |
http://erlangquicktips.heroku.com/2010/01/06/following-a-spiral/ | |
''' | |
def spiral(l): | |
'''Take a list of lists that is assumed to be in row major order. | |
Return a list generated by iterating through the elements of the structure | |
in a spiral that moves closer to the center as you move clockwise. |
This file contains 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
git config --global --add "difftool.twdiff.cmd" 'twdiff --wait "$LOCAL" "$REMOTE"' | |
git config --global diff.tool twdiff |
NewerOlder