Skip to content

Instantly share code, notes, and snippets.


Thomas Powell stringsn88keys

View GitHub Profile
stringsn88keys / .zlogin
Last active Aug 29, 2015
A section of my .zlogin to notify me when a process > 4 minutes finishes. (Mac-specific)
View .zlogin
export PMPSVN=''
export PATH=~/bin:$PATH
export DYLD_LIBRARY_PATH=~/instantclient_11_2
#alias gvim='mvim'
export EDITOR=/usr/local/bin/mvim
export RSENSE_HOME=~/.vim/bundle/rsense
export PATH="/Library/PostgreSQL/9.2/bin:/usr/local/narwhal/bin:$PATH"
stringsn88keys / hacking "no return"
Created Jan 21, 2013
The mission: remove "return" from the following function. def multiple_of_three(n) return n % 3 == 0 ? "True" : "False" end
View hacking "no return"
# I figured that the "correctness" test is the existence of "return" as a word within the function, so...
def multiple_of_three(n)
eval "#{'r e tu rn'.split.join} n % 3 == 0 ? \"True\" : \"False\""
stringsn88keys / mapping.rb
Last active Dec 15, 2015
Translation of Betterment format to Drake software format (as documented, then as discovered.)
View mapping.rb
# This is the layout that Drake had documented (coming from Betterment format)
oldLayoutJustForReference = <<-LAYOUT
4,Date Sold (MMDDYYYY),column[:f]
5,Date Acquired (MMDDYYYY),column[:e]
View BlinkAndAnalogRead
Turns on an LED on for one second, then off for one second, repeatedly.
This example code is in the public domain.
// Pin 13 has an LED connected on most Arduino boards.
// give it a name:
int led = 13;
stringsn88keys / invert_as_arrays.rb
Created Sep 12, 2013
Patch to invert mappings of [key, value] in Hash to mappings of [value, [key1, key2, key3]]
View invert_as_arrays.rb
class Hash
def invert_as_arrays
self.inject({}) { |r,x| r[x[1]] ||= []; r[x[1]] << x[0]; r }
stringsn88keys / .vimrc
Last active Jun 25, 2016
My current .vimrc file
View .vimrc
"let g:powerline_config_overrides={"common":{"log_file":"/tmp/powerline.log"}}
call pathogen#infect()
call pathogen#helptags()
" colors candycode
" colors borland
" colors vividchalk
" colors tango
" colors brookstream
" colors chocolateliquor
stringsn88keys / init.lua
Created Apr 1, 2017
Hammerspoon init script that allows 1-9 to move windows into 9ths of the screen
View init.lua
function move_to_third(r,c)
local win = hs.window.focusedWindow()
local f = win:frame()
local screen = win:screen()
local extents = screen:frame()
f.x = extents.x + (extents.w / 3) * c
f.y = extents.y + (extents.h / 3) * r
f.w = extents.w / 3
f.h = extents.h / 3
stringsn88keys / wp-config.fake.snippet.php
Last active Jul 3, 2017
Fake wp-config snippet for instructions on moving from Dreamhost to Linode
View wp-config.fake.snippet.php
// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'wp_example_com');
/** MySQL database username */
define('DB_USER', 'examplecom');
/** MySQL database password */
define('DB_PASSWORD', 'ASD9@!h12');
stringsn88keys / mysqldump command
Last active Jul 3, 2017
Mysqldump example for extracting wordpress
View mysqldump command
mysqldump wp_example_com --host -u examplecom -p >
View apache2.conf
<Directory /var/www/html/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted