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/sh | |
# Copyright (c) 2014 | |
# | |
# Author: Stein Fletcher <[email protected]> | |
# | |
# /etc/rc.d/mongod | |
# | |
MONGOD_BIN=/usr/local/bin/mongod | |
test -x $MONGOD_BIN || exit 5 |
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
var data = { | |
"name": "root", | |
"contents": [ | |
{ | |
"name": "A", | |
"contents": [ | |
{ | |
"name": "fileA1", | |
"contents": [] | |
} |
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
#!/usr/bin/env python | |
import os | |
import json | |
class Node: | |
def __init__(self, id, text, parent): |
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 | |
# Author: Stein Fletcher <[email protected]> | |
# Purpose: Changes the mac address for the en0 device | |
# get the current mac address | |
old_addr=`/sbin/ifconfig en0 | awk '/ether/ {print $2}'` | |
# Generates a random new mac address using openssl | |
new_addr=`openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//'` |
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({ | |
'immutableMerge': function(src, dest) { | |
return _.merge(_.cloneDeep(src), dest); | |
} | |
}); | |
// usage | |
var src = { | |
a: 1, |
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
import Control.Exception | |
import System.Environment (getArgs) | |
catchAny :: IO a -> (SomeException -> IO a) -> IO a | |
catchAny = Control.Exception.catch | |
parseArgs :: [a] -> a | |
parseArgs args | |
| (length args) == 1 = head args | |
| otherwise = error "Invalid args. \nUsage: words <file>" |
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
alias g='git' | |
alias gst='git status' | |
alias gd='git diff' | |
alias gdc='git diff --cached' | |
alias gdt='git diff-tree --no-commit-id --name-only -r' | |
alias gl='git pull' | |
alias gup='git pull --rebase' | |
alias gp='git push' | |
alias gd='git diff' | |
alias gdt='git difftool' |
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
#!/usr/bin/env bash | |
# generate a 2048-bit RSA private key | |
openssl genrsa -out private_tmp_key.pem 2048 | |
# convert private Key to PKCS#8 format (so Java can read it) | |
openssl pkcs8 -topk8 -inform PEM -in private_tmp_key.pem -out private_key.pem -nocrypt | |
# generate a public key from the private one | |
openssl rsa -pubout -in private_tmp_key.pem -out public_key.pem |
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
import base64 | |
import json | |
import optparse | |
import os | |
import urllib2 | |
from subprocess import call | |
from threading import Thread | |
"""Script to clone all GitHub repositories owned by an organisation team |
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
import * as React from 'react' | |
import * as Redux from 'redux' | |
import { MyReduxState } from './my-root-reducer.ts' | |
export interface OwnProps { | |
propFromParent: number | |
} | |
interface StateProps { |
OlderNewer