This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
/* | |
SortTable | |
version 2 | |
7th April 2007 | |
Stuart Langridge, http://www.kryogenix.org/code/browser/sorttable/ | |
Instructions: | |
Download this file | |
Add <script src="sorttable.js"></script> to your HTML | |
Add class="sortable" to any table you'd like to make sortable |
This file contains hidden or 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 subproc | |
import time | |
subproc.Popen('calc') | |
print('now close this window and see calc closing itself') | |
while True: | |
time.sleep(1) |
This file contains hidden or 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
""" | |
These two repr implementations make a "repr" that you can just drop into your class if it's a simple one. | |
""" | |
class A: | |
def __init__(self, x, y): | |
self.x = x | |
self.y = y | |
def __repr__(self): | |
return "%s(**%r)" % (self.__class__.__name__, self.__dict__) |
This file contains hidden or 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 sys | |
import pprint | |
import json | |
import requests | |
base_url = 'http://localhost:9200' | |
INDEX_COUNT = 400 |
This file contains hidden or 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
""" | |
Thank you | |
http://stackoverflow.com/a/24588289/177498 | |
""" | |
def debug(): | |
import logging | |
# These two lines enable debugging at httplib level (requests->urllib3->http.client) | |
# You will see the REQUEST, including HEADERS and DATA, and RESPONSE with HEADERS but without DATA. |