Skip to content

Instantly share code, notes, and snippets.

@jhelwig
jhelwig / .gitconfig
Created June 17, 2015 16:38
Review aliases
[alias]
review = log -p --reverse -M -C -C --patience
review-topic = !sh -c 'git review ${1}^1..${1}^2' -
view-topic = !sh -c 'git log --reverse --stat -M -C -C ${1}^1..${1}^2' -
@jhelwig
jhelwig / keybase.md
Last active October 17, 2016 07:31
keybase.md

Keybase proof

I hereby claim:

  • I am jhelwig on github.
  • I am jhelwig (https://keybase.io/jhelwig) on keybase.
  • I have a public key ASBMutzBT6b4i8YyGmeDPQ-soW5KGtFuKUNAsW3xG3XKsAo

To claim this, I am signing this object:

{
"variables": {
"http_temp_dir": null,
"vm_platform": "centos",
"vm_version": "{{timestamp}}",
"cpu_count": "1",
"memory_mb": "1024",
"disk_mb": "40000",
"iso_url_base": "http://baker/kickstart_isos/isos/centos/",
"iso_name": "centos-20140307T012531-production.iso",
@jhelwig
jhelwig / Guardfile
Created December 4, 2012 16:11
Auto-commit & run tests on every save
# More info at https://github.com/guard/guard#readme
ignore /^coverage\//
require 'tempfile'
notification :'terminal_notifier'
#notification :tmux,
# :display_message => true,
# :timeout => 5, # in seconds
guard 'shell' do
watch(/(.*)/) do |m|
if system("git ls-files --exclude-standard -d -o -m | egrep '.' > /dev/null")
test_output = Tempfile.new('guard_commit_test_output')
test_output.close
tests_passing = system("rake 2>&1 >> #{test_output.path}")
commit_message = Tempfile.new('guard_commit_message')
commit_message.write("WIP: #{m[0]} (Tests: #{tests_passing ? 'passing' : 'failing'})\n\n")
commit_message.write(File.read test_output.path)
@jhelwig
jhelwig / ant-clean-debug-install-all
Created July 15, 2012 17:25
Android CLI helpers
#!/bin/bash
# This assumes that there is a file named .activity-to-launch where the sole
# contents are the name of the activity to launch on each device.
#
# For example:
# net.technosorcery.rally.ts_200/net.technosorcery.rally.ts_200.MainActivity
ant clean
@jhelwig
jhelwig / tic-tac-toe-count-fun-bug.rb
Created December 7, 2011 07:31
PDX.rb I Spy 2011-12-06
require 'rubygems'
def row(i)
[i % 3, (i/3) % 3, (i/9) % 3]
end
def row_number(r)
r[0]+3*r[1]+9*r[2]
end
@jhelwig
jhelwig / iptables.sh
Created November 18, 2011 18:36
Clear iptables to accept everything
#!/bin/sh
# IPv4
IPT=/sbin/iptables
# Reset iptables
$IPT -P INPUT ACCEPT
$IPT -P OUTPUT ACCEPT
$IPT -P FORWARD ACCEPT
$IPT -F
#!/bin/sh
set -e
set -x
echo ENV
env | grep GIT
echo CN $GIT_COMMITTER_NAME
echo CE $GIT_COMMITTER_EMAIL
%{_topdir} %{getenv:HOME}/rpmbuild
%{_builddir} %{_topdir}/BUILD
%{_rpmdir} %{_topdir}/RPMS
%{_sourcedir} %{_topdir}/SOURCES
%{_specdir} %{_topdir}/SPECS
%{_srcrpmdir} %{_topdir}/SRPMS
%{_buildrootdir} %{_topdir}/BUILDROOT
%{buildroot} %{_buildrootdir}/%{name}-%{version}-%{release}.%{_arch}
$RPM_BUILD_ROOT %{buildroot}