Skip to content

Instantly share code, notes, and snippets.

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)
@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 = []
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 / 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
#!/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//./_}