Skip to content

Instantly share code, notes, and snippets.


Wes Mason 1stvamp

View GitHub Profile
1stvamp / gist:9133125
Created Feb 21, 2014
Testing reliability of typesafe === operator in PHP for use in unit tests
View gist:9133125
$ phpsh
Starting php
type 'h' or 'help' to see instructions & features
php> echo array('foo'=>'bar') === array('foo'=>'bar')
php> echo array('foo'=>'baz') === array('foo'=>'bar')
php> echo array('foo'=>array(1)) === array('foo'=>array())
php> echo array('foo'=>array(1)) === array('foo'=>array(1))
1stvamp /
Created Feb 24, 2014
Simple tool for displaying contents of celery messages
from base64 import b64decode
from json import loads
from pprint import pprint
def parse_celery_msg(msg):
for NAME in ls $DIRPATH;
if [ "$NAME" != "$NAME" ]; then
1stvamp / lumi_header_fix.css
Last active Aug 29, 2015
Make the header more useful (by making it get the hell out of my way)
View lumi_header_fix.css
height: 69px !important;
position: absolute !important;
#header primary
height: 69px !important;
1stvamp /
Created Mar 28, 2014
My keybase info

Keybase proof

I hereby claim:

  • I am 1stvamp on github.
  • I am 1stvamp ( on keybase.
  • I have a public key whose fingerprint is 92B0 8721 F96D 152C 1C6B 3570 121D B795 2C93 970C

To claim this, I am signing this object:

1stvamp / playboard.yaml
Created Jun 27, 2014
Graceful or hard restart of service in ansible based on changed binary
View playboard.yaml
- hosts: localhost
- name: check for new payload
tags: config-changed
shell: if [ "$(md5sum {{ executable_path }})" != "$(cat {{ executable_md5_path }})" ]; then echo "changed"; fi
register: md5diff
changed_when: md5diff.stdout == "changed"
- name: store new payload md5
1stvamp / snappy-ppa-1500
Created Dec 15, 2014
apt pinning preferences for snappy ppa
View snappy-ppa-1500
Package: *
Pin: release o=LP-PPA-snappy-dev-beta
Pin-Priority: 15000

The current situation

The current spec states that ports are a top level entry in the package.yaml as

    name: go-example-webserver
    vendor: Alexander Sack <>
    architecture: amd64
    icon: meta/go.svg
    version: 1.0.1
1stvamp /
Last active Aug 29, 2015
Example of returning multiple directed commands in a hippybot plugin
from hippybot.decorators import botcmd
class Plugin(object):
command_aliases = {'^5s': 'high_fives'}
def high_fives(self, msg, **kwargs):
users = [
unicode(msg.getFrom()).split("/")[1].replace(' ', ''),
1stvamp /
Created May 26, 2015
Automatically adjust noise cancellation for X220 clickpad if plugged into power
# /usr/lib/pm-utils/power.d/
case $1 in
true) DISPLAY=:0 xinput --set-prop "SynPS/2 Synaptics TouchPad" 303 60, 60 ;;
false) DISPLAY=:0 xinput --set-prop "SynPS/2 Synaptics TouchPad" 303 15, 15 ;;
exit 0