Skip to content

Instantly share code, notes, and snippets.

View spf13's full-sized avatar
💭
I may be slow to respond.

Steve Francia spf13

💭
I may be slow to respond.
View GitHub Profile
[alias]
st = status
ci = commit
co = checkout
stat = status
edit-unmerged = "!f() { git ls-files --unmerged | cut -f2 | sort -u ; }; $EDITOR `f`"
add-unmerged = "!f() { git ls-files --unmerged | cut -f2 | sort -u ; }; git add `f`"
lc = log ORIG_HEAD.. --stat --no-merges
smash = merge --no-commit --log
eat = branch -M
@spf13
spf13 / Genealogy.js
Created February 3, 2012 18:13
Genealogy Schema for MongoDB
individual = {
_id : ObjectId("4f2978dfaa999d9db02618ce"),
AFN : '1XYK-KQJ',
name: {
first: ['john', 'johannes'],
middle: 'peter',
last: ['smith', 'sandvik']
},
events : [
@spf13
spf13 / mongoHadoopInstall.sh
Created February 22, 2012 22:02
MongoHadoop Install
hadoop_version='0.23'
hadoop_path="/usr/local/Cellar/hadoop/$hadoop_version.0/libexec/lib"
git clone git://github.com/mongodb/mongo-hadoop.git
cd mongo-hadoop
sed -i '' "s/default/$hadoop_version/g" build.sbt
cd streaming
./build.sh
ln -s ~/.ivy2/cache/org.mongodb/mongo-java-driver/jars/mongo-java-driver-2.7.3.jar .
@spf13
spf13 / MongoHadoopTwitterStreaming.sh
Created February 22, 2012 22:15
MongoHadoopTwitterStreaming
hadoop jar mongo-hadoop-streaming.jar \
-mapper examples/twitter/twit_map.py \
-reducer examples/twitter/twit_reduce.py \
-inputURI mongodb://127.0.0.1/test.live \
-outputURI mongodb://127.0.0.1/test.twit_reduction \
-file examples/twitter/twit_map.py \
-file examples/twitter/twit_reduce.py
@spf13
spf13 / img.html
Created December 10, 2013 19:14
img.html shortcode
<!-- image -->
<figure {{ if isset .Params "class" }}class="{{ index .Params "class" }}"{{ end }}>
{{ if isset .Params "link"}}<a href="{{ index .Params "link"}}">{{ end }}
<img src="{{ index .Params "src" }}" {{ if or (isset .Params "alt") (isset .Params "caption") }}alt="{{ if isset .Params "alt"}}{{ index .Params "alt"}}{{else}}{{ index .Params "caption" }}{{ end }}"{{ end }} />
{{ if isset .Params "link"}}</a>{{ end }}
{{ if or (or (isset .Params "title") (isset .Params "caption")) (isset .Params "attr")}}
<figcaption>{{ if isset .Params "title" }}
<h4>{{ index .Params "title" }}</h4>{{ end }}
{{ if or (isset .Params "caption") (isset .Params "attr")}}<p>
{{ index .Params "caption" }}

Keybase proof

I hereby claim:

  • I am spf13 on github.
  • I am spf13 (https://keybase.io/spf13) on keybase.
  • I have a public key whose fingerprint is 87A5 581C C823 7583 0E71 F3F5 2793 1F46 4397 80A0

To claim this, I am signing this object:

@spf13
spf13 / CLA
Last active November 24, 2015 03:18
Developer Certificate of Origin
Version 1.1
Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
660 York Street, Suite 102,
San Francisco, CA 94110 USA
Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.
@spf13
spf13 / DCO
Created November 2, 2015 22:36
Developer Certificate of Origin
Version 1.1
Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
660 York Street, Suite 102,
San Francisco, CA 94110 USA
Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.
git ls-tree -r -z --name-only HEAD -- */* | xargs -0 -n1 git blame \
-CM --minimal -f |grep -i "USERNAME"
1 USER TO SIGN/REWRITE:
[ 1 1 53 ] dylanmackenzie https://github.com/dylanmackenzie
1032 by dylanmackenzie https://github.com/spf13/hugo/pull/1032
+ 51 , - 2
commands/server.go
helpers/path.go
@spf13
spf13 / win_autoinstall_chocolatey.ps1
Last active November 7, 2015 04:32
Windows autoinstaller of programs using chocolatey. (Remove last line if you need to keep track of which packages were installed)
# Run the following line to execute this script
#@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://gist.githubusercontent.com/spf13/206a1be3f98f9d72c4a8/raw/15b8000d565f1370763a1826573be51541af682b/win_autoinstall_chocolatey.ps1'))
#########################
# Autoinstall script using chocolatey
#########################
# Note: Net 4.0 must be installed prior to running this script
#
#Modify this line to change packages
$items = @("GoogleChrome", "skype", "vlc", "quicktime", "flashplayerplugin", "javaruntime", "DotNet4.5", "dropbox", "Teracopy", "7zip.install", notepadplusplus.install", "git.install", "ConEmu", "cpu-z", "f.lux", "ffmpeg", "golang", "hg", "KickAssVim", "poweriso", "linkshellextension", "lastpass", "ConsoleZ", "SourceTree", "putty", "vim", "svn", "wget", "winscp", "windirstat", "speccy", "ctags", "ChocolateyGUI")