Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
function tmux_create {
SESSION_NAME=$1
tmux new -s $SESSION_NAME -n neovim
}
#new session base name is current directory name
DIR_NAME=${PWD##*/}
DIR_NAME=${DIR_NAME//./_}
@binarymatt
binarymatt / gv.sh
Last active May 11, 2022 15:50
go version script
#!/usr/bin/env bash
function _current_version() {
#echo ${v#go};
local current=`go version | { read _ _ v _; echo ${v#go}; }`
echo $current
}
function _change_symlink() {
if [ -z "$1" ]; then
echo "no version passed in"
return
on run {input, parameters}
set inputVolume to input volume of (get volume settings)
if inputVolume = 0 then
set inputVolume to 100
set displayNotification to "Microphone Unmuted"
else
set inputVolume to 0
set displayNotification to "Microphone Muted"
end if
@binarymatt
binarymatt / rows.py
Created February 8, 2016 20:19
records.py in sqlalchemy
import tablib
from sqlalchemy import create_engine
from sqlalchemy.sql import text
class ResultSet(object):
def __init__(self, result_proxy):
self._rp = result_proxy
self.colum_names = self._rp.keys()
self._all_rows = []
import collections
class DummyDict(collections.UserDict):
def __getattr__(self, attr):
return self['temp'+attr]
def __setattr__(self, attr, value):
self['temp"+attr] = value
d = DummyDict()
for my_data in dates:
setattr(d, my_data, len(my_data)
from hypothesis.testdecorators import given
def me(x,y):
if x < y:
raise Exception('this is an error')
return True
def test_answer():
assert me(5,3) == True
@given(int, int)

Keybase proof

I hereby claim:

  • I am binarydud on github.
  • I am mattg (https://keybase.io/mattg) on keybase.
  • I have a public key whose fingerprint is E61B 4499 CE2A 932A 35F7 BF84 8D45 DFEE 618B 520A

To claim this, I am signing this object:

#!/usr/bin/python
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford (jspenguin@jspenguin.org)
# The author disclaims copyright to this source code.
# Quickly and dirtily modified by Mustafa Al-Bassam (mus@musalbas.com) to test
# the Alexa top X.
# Modified by Matt George (mgeorge@gmail) to test arbitrary domains

Keybase proof

I hereby claim:

  • I am binarydud on github.
  • I am mattg (https://keybase.io/mattg) on keybase.
  • I have a public key whose fingerprint is 84F7 580E 24CE 33D1 8B49 2F29 DC60 0858 4A6F 5CB2

To claim this, I am signing this object:

@binarymatt
binarymatt / tariff.py
Last active January 2, 2016 12:39
factory method
from .base import AbstractTariff
from .us import USTariff
from .ca import CATariff
def factory(name):
mod = sys.modules[__name__]
classname = '{}Tariff'.format(name)
return getattr(mod, classname, None)