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 pprint | |
import os | |
from collections import Counter | |
ascii_markers = "|\\/_\" ()n" | |
def ascii_prob(line): | |
line = line.strip() |
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
""" | |
Data from | |
http://en.wikipedia.org/wiki/CPU_socket#List_of_80x86_sockets_and_slots | |
copy pasted html to excel, copy pasted excel to python | |
ran python | |
pasted output to excel, drew a graph | |
There's probably a simpler way to do a pivot table but I don't know how. |
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
var origin = function () { | |
// IE10 Doesn't have window.location.origin :( | |
if (!window.location.origin) { | |
var port = window.location.port ? ':' + window.location.port : ''; | |
return window.location.protocol + "//" + window.location.hostname + port; | |
} else { | |
return window.location.origin; | |
} | |
} |
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/python | |
""" | |
Control volume on an alsamixer in ubuntu from the command line using python-alsaaudio | |
Written for Crouton Chromebooks to have easy hotkeys for their volume control in ubuntu. | |
https://github.com/dnschneid/crouton/wiki/Keyboard | |
usage: |
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
javascript:(function(){var s=document.createElement('script');s.src='https://cdnjs.cloudflare.com/ajax/libs/mark.js/7.0.0/mark.min.js';s.onload=function(){(new Mark(document.body)).mark(["err", "warn", "fail", "exception"])};document.head.appendChild(s);})() |
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
""" | |
Inspired by this bogus TIL: https://www.reddit.com/r/todayilearned/comments/54c05w/til_there_are_923_words_in_the_english_language/ | |
Downloaded this corpus: https://sourceforge.net/projects/wordlist/files/SCOWL/2016.06.26/scowl-2016.06.26.zip/download?use_mirror=pilotfiber | |
From http://wordlist.aspell.net/ | |
SCOWL (Spell Checker Oriented Word Lists) | |
The results of running this script are: |
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
# Echo server program | |
import socket | |
import time | |
# Symbolic name meaning all available interfaces | |
HOST = '' | |
# Arbitrary non-privileged port | |
PORT = 18080 | |
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
s.bind((HOST, PORT)) |
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
<style> | |
/* This is my error handler to show myself and users when errors are happening */ | |
/* See: https://gist.github.com/ubershmekel/66abb3987b116b4824201f9cd72e1dd9 /* | |
/* style from http://www.w3schools.com/howto/howto_js_snackbar.asp */ | |
/* The snackbar - position it at the bottom and in the middle of the screen */ | |
#snackAlertsContainer { | |
position: fixed; /* Sit on top of the screen */ | |
z-index: 1; /* Add a z-index if needed */ | |
bottom: 30px; /* 30px from the bottom */ | |
width: 100%; |
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
Windows Registry Editor Version 5.00 | |
[HKEY_CLASSES_ROOT\Directory\shell\ccollab] | |
@="CodeCollab Review" | |
"Icon"="\"C:\\Program Files\\Collaborator Client\\ccollab.exe\"" | |
[HKEY_CLASSES_ROOT\Directory\shell\ccollab\command] | |
@="\"C:\\Program Files\\Collaborator Client\\ccollab.exe\" addchanges ask %V" | |
[HKEY_CLASSES_ROOT\Directory\Background\shell\ccollab] |
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
""" | |
Concatenate a few video files into one with ffmpeg | |
Use a wild card | |
""" | |
import subprocess | |
import glob | |
import re | |
to_concat = 'robocar*' |