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 | |
# Usage: | |
# | |
# $ metrics.sh > dynamo_tables.txt | |
# | |
# $ cat dynamo_tables.txt \ | |
# | tr : ' ' \ | |
# | sed 's/\./ /' \ | |
# | sed 's/ =//' \ |
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 | |
# Update TypeScript `typings` to their latest versions. | |
# | |
# Running this ad-hoc may break your project; be prepared to resolve issues by | |
# hand. | |
# | |
# Released under the terms of the MIT License | |
set -e |
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
// Redux actions using TypeScript discriminated unions | |
// | |
// Source: https://github.com/rjz/typescript-react-redux/ | |
// Actions | |
export type Action = | |
{ type: 'INCREMENT_COUNTER', delta: number } | |
| { type: 'RESET_COUNTER' } | |
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 ( | |
"encoding/base64" | |
"errors" | |
"fmt" | |
"github.com/google/go-github/github" | |
) | |
// Extract a Blob with arbitrary encoding into a byte array | |
func ExtractBlob(blob *github.Blob) (*[]byte, error) { | |
bytes := []byte(*blob.Content) |
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 -e | |
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
FILENAME="$( basename "${BASH_SOURCE[0]}" )" | |
PROJECTDIR="$(readlink "${DIR}/../..")" # $DIR == ${PROJECTDIR}/.git/hooks | |
log () { | |
echo -e "\e[90m[`date -u +"%Y-%m-%dT%H:%M:%SZ"`]\e[39m - \e[36m$FILENAME\e[39m - $1" |
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
// Now available in package form at https://github.com/rjz/githubhook | |
package handler | |
// https://developer.github.com/webhooks/ | |
import ( | |
"crypto/hmac" | |
"crypto/sha1" | |
"encoding/hex" | |
"errors" |
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 { Component } from "React"; | |
export var Enhance = ComposedComponent => class extends Component { | |
constructor() { | |
this.state = { data: null }; | |
} | |
componentDidMount() { | |
this.setState({ data: 'Hello' }); | |
} | |
render() { |
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
// Hello. There is now a module for this. | |
// https://github.com/0x8890/error-class | |
// $ npm install error-class | |
const hasCaptureStackTrace = 'captureStackTrace' in Error | |
// Internal function to set up an error. | |
function setup (message) { | |
const { constructor, constructor: { name } } = this |
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/sh | |
# Linux x64 install for Facebook's flow JS type checker (flowtype.org). Flow | |
# will be installed to the local directory, replacing any previous versions | |
# placed here by this script. | |
ZIP=flow-linux64-latest.zip | |
URL=http://flowtype.org/downloads/$ZIP | |
BINDIR=flow |
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
/* | |
* Flyspeck is Dependency Injection Container. | |
* | |
* Copyright (c) 2014 Anton Medvedev | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy | |
* of this software and associated documentation files (the "Software"), to deal | |
* in the Software without restriction, including without limitation the rights | |
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
* copies of the Software, and to permit persons to whom the Software is furnished |
NewerOlder