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 | |
# cloccomment.py - using cloc, return percentage of code that is comments | |
# usage: cloccomment <arguments to be passed to cloc> | |
import sys | |
import subprocess | |
args = sys.argv[1:] | |
results = subprocess.check_output(['cloc'] + args).decode('utf-8') |
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
// TypeScript bindings for react-sortable-tree | |
declare module "react-treebeard" { | |
import * as React from 'react'; | |
export interface Node { | |
id?: string; | |
name: string; | |
active?: boolean; | |
toggled?: boolean; |
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
class ArrayView { | |
constructor(array, x, y, width, height) { | |
this.array = array; | |
this.x = x; | |
this.y = y; | |
// Automatic bounding | |
// x = 30, width of backing array = 50, width of this = 30 | |
// width = 50 - 30 = 20 | |
let max_width = array.width - x; |
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
// webpack.config.js - webpack 2 + babel + react + separate LESS to css file config | |
// Required packages: | |
// yarn add --dev webpack babel-loader babel-core babel-preset-es2015 babel-preset-react extract-text-webpack-plugin less css-loader style-loader less-loader | |
const ExtractTextPlugin = require('extract-text-webpack-plugin'); | |
module.exports = { | |
entry: './src/index.js', |
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
# removes all metadata from react-native log output | |
/opt/android-sdk/platform-tools/adb logcat -v raw "*:S" ReactNative:V ReactNativeJS:V |
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 | |
# https://groups.google.com/forum/#!topic/golang-nuts/t9dLLVwsMlM | |
# run in a directory of git repos e.g. ~/go/src/golang.org/x | |
for dir in ./*; do # use ./*/* for two-level directories eg ~/go/src/github.com | |
pushd $dir; | |
git pull --ff-only origin master; | |
popd; | |
done |
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
filetype plugin indent on | syntax on | set ruler gd hls scs ic hid ts=2 sts=2 sw=2 tw=79 fo=cq nuw=5 wmnu wim=full cul cino=l1,(0 t_Co=256 | map ; : |
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 html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title></title> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<!--[if lt IE 9]> | |
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.6.2/html5shiv.js"></script> | |
<![endif]--> | |
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
# amazon.rb - amazon affiliate links for jekyll | |
# assumes that you have a configuration variable called 'amazon_associate_id' with your associate id | |
# usage: {{ asin | amazon_product_href }} | |
# returns url of a product | |
# usage: {{ asin | amazon_image_href: 'M' }} | |
# returns image of the product, size argument can be S, M, or L, default M | |
# usage: {{ asin | amazon_product: 'A Product' }} |