This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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//./_} |
OlderNewer