Skip to content

Instantly share code, notes, and snippets.

View CloudCray's full-sized avatar

Cloud Cray CloudCray

  • Cedar
  • Cleveland, OH
View GitHub Profile
@CloudCray
CloudCray / activate
Created February 3, 2020 15:50
Bash script to activate virtual environments by name
#!/bin/bash
#
# virtualenvs must be in `~/venv`
# save this as /usr/local/bin/activate
# file is sourced instead of executed - need read permissions only
# `sudo chmod 644 /usr/local/bin/activate`
#
VIRTUAL_ENV="/home/$USER/venv/$1"
export VIRTUAL_ENV
ACT_SCRIPT='source $VIRTUAL_ENV/bin/activate'
@CloudCray
CloudCray / keybase.md
Created March 8, 2017 14:48
keybase.md

Keybase proof

I hereby claim:

  • I am cloudcray on github.
  • I am cloudcray (https://keybase.io/cloudcray) on keybase.
  • I have a public key ASAz4XwtHslcnqWh1ZGoQVYtKDEwKi41H4jYHU-msqsErQo

To claim this, I am signing this object:

@CloudCray
CloudCray / reimport.py
Created October 14, 2016 15:32
Python 3.4+ Reimport
from foo.bar import baz
import importlib
import foo.bar
importlib.reload(foo.bar)
from foo.bar import baz
@CloudCray
CloudCray / text-copypasta.txt
Last active September 26, 2016 14:35
Text faces quick reference
¿uɐᴉlɐɹʇsn∀ ʞɐǝds noʎ op ʇnq 'ǝɯ ǝsnɔxƎ
@CloudCray
CloudCray / keybase.md
Created August 31, 2016 18:42
keybase.md

Keybase proof

I hereby claim:

  • I am cloudcray on github.
  • I am cloudcray (https://keybase.io/cloudcray) on keybase.
  • I have a public key whose fingerprint is 2ED0 3D64 A12D 1744 40E4 25D9 2910 1C9D F1E1 92D6

To claim this, I am signing this object:

@CloudCray
CloudCray / dance_sport_info.json
Last active March 27, 2016 01:11
Proposed Mark Data Structure
[
{
"event_id": "Amateur_Pre-Champ_Standard_(WTFQ)_453645",
"comp_id": "Keystone_DanceSport_Classic_2016_31533",
"event_name": "Amateur Pre-Champ Standard (WTFQ)",
"details": {
"results": [
{
"rank_end": 1390,
"round_reverse_index": 0,
@CloudCray
CloudCray / export_custom.py
Last active February 9, 2016 20:14
Export custom pages from readme.io
# Python 3
import urllib.parse as p
import bs4
import os
import json
import requests
class ReadMeIOImporterExporter:
@CloudCray
CloudCray / itunes_scrub.py
Created March 14, 2015 23:30
Remove broken iTunes links
import win32com.client
iTunes = win32com.client.gencache.EnsureDispatch("iTunes.Application")
lpl = iTunes.LibraryPlaylist
track_indices = []
for i in range(lpl.Tracks.Count):
trk = lpl.Tracks(i+1) # iTunes has a 1-based index
if trk.Kind == 1:
@CloudCray
CloudCray / ndca-adjudicators.py
Last active August 29, 2015 14:14
Download csv of NDCA judges
import urllib
import bs4
import csv
p = urllib.parse
request = urllib.request
url = 'http://www.ndca.org/directories/'
urls = []
for i in range(18): # There are 436 adjudicators right now; the loads in sets of 25. 18 pages needed
@CloudCray
CloudCray / export_to_pdf.py
Last active November 23, 2018 07:25
Quick script to convert IPython Notebooks to PDFs
# Author: Cloud Cray
# 2014-12-30
# Run this script in the same folder as the notebook(s) you wish to convert
# This will create both an HTML and a PDF file
#
# You'll need wkhtmltopdf (this will keep syntax highlighting, etc)
# http://wkhtmltopdf.org/downloads.html
import subprocess
import os