Skip to content

Instantly share code, notes, and snippets.

Greg Sadetsky gregsadetsky

Block or report user

Report or block gregsadetsky

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
dopiaza / slackpost
Created Sep 5, 2013
Post a message to a Slack channel
View slackpost
# Usage: slackpost <token> <channel> <message>
# Enter the name of your slack host here - the thing that appears in your URL:
EyalAr /
Created Dec 11, 2013
Demo code for my post about python's blocking stream reading functions.
from subprocess import Popen, PIPE
from time import sleep
# run the shell as a subprocess:
p = Popen(['python', ''],
stdin = PIPE, stdout = PIPE, stderr = PIPE, shell = False)
# issue command:
# let the shell output the result:
quellish / FBClasses.txt
Created Aug 15, 2015
Facebook iOS App Class List
View FBClasses.txt
skoji /
Created Nov 2, 2015
remove Slack settings (OS X)
rm -rf ~/Library/Application\ Support/Slack/
rm -rf ~/Library/Containers/com.tinyspeck.slackmacgap/
rm -rf ~/Library/Preferences/com.tinyspeck.slackmacgap.plist
rm -rf ~/Library/Saved\ Application\ State/com.tinyspeck.slackmacgap.savedState
rm ~/Library/Safari/LocalStorage/*slack*
lonetwin /
Last active Nov 8, 2019
print out ascii tables in python using data in the form: [ ('column 0 title', 'column 1 title' ..), ('row 0, column 0 data', 'row 0, column 1 data' ...) ...]
# I needed to print out ascii tables from data in the form:
# [ ('column 0 title', 'column 1 title' ..),
# ('row 0, column 0 data', 'row 0, column 1 data' ...) ...]
# and surprisingly it got complicated because of variable lengths of the data.
# I googled for 'standard' ways of doing this and I found suggestions like:
# ...which were a bit dated and hard to read or full scale modules like:
akuzemchak / Side Bar.sublime-menu
Created Aug 13, 2011
Reveal folder in Finder for Sublime Text 2
View Side Bar.sublime-menu
# add this to the main command array...
{ "caption": "Open Containing Folder…", "command": "open_this_folder", "args": {"dirs": []} }
View ascii-art-browser-console.js
* © 2016 - Julián Acosta
* License: CC BY-SA 4.0 (
* Print your own logo in developer tools!
* Step 1: Convert your logo to ASCII text here: (I used color output)
* Note: Is possible that you'll have to resize your photo in order to retain aspect ratio
* Step 2: Remove the <pre></pre> tag that is surrounding the generated code, replace with "[" and "]"
* Step 3: Run the following regexes (*DON'T ALTER THE ORDER*) in order to convert to JSON (Works in PHPStorm and Sublime Text 2):
JosephRedfern / YouTube 8m Video ID
Created Sep 28, 2016
Scrapes the youtube video IDs for the youtube-8m data set. Probably buggy. Could be threaded.
View YouTube 8m Video ID
import requests
from collections import defaultdict
csv_prefix = ""
r = requests.get("{0}/verticals.json".format(csv_prefix))
verticals = r.json()
block_urls = defaultdict(list)
count = 0
sintaxi / regions.txt
Last active May 15, 2019
Surge Regions
View regions.txt
List of regions your project is served from when you deploy using surge. : : CA : Toronto : : US : New York : : US : San Francisco : : GB : London : : NL : Amsterdam : : DE : Frankfurt : : SG : Singapore
gregsadetsky /
Last active Apr 26, 2019
See: -- I was looking for a way to run Selenium tests for a Django app on a staging server hosted on Heroku using a PostgreSQL database. The DjangoTestSuiteRunner creates and destroys the whole database before/after testing, which would not work on Heroku where databases are added via other means (her…
import dj_database_url
'default': dj_database_url.config(env='TEST_DATABASE_URL')
# replace path below to point to HerokuTestSuiteRunner class
You can’t perform that action at this time.