Skip to content

Instantly share code, notes, and snippets.

View FSX's full-sized avatar
💭
I may be slow to respond.

Frank FSX

💭
I may be slow to respond.
View GitHub Profile
wget -O - https://raw.github.com/gist/1069010/python.sh | sh
@ei-grad
ei-grad / example.py
Created November 30, 2011 01:46
threaded decorator for tornado
from time import sleep
from tornado import gen
import tornado.ioloop
import tornado.web
from tornado_threaded import threaded, inline_threaded
@threaded
def slow_func(callback):
#!/usr/bin/tclsh8.5
#
# Usage: unmerged branch1 branch2
proc getlog branch {
lrange [split [exec git log $branch --oneline] "\n"] 0 100
}
proc diff {title c1 c2} {
puts "\n$title"
@franzliedke
franzliedke / about.md
Created August 31, 2012 19:41 — forked from jasonrudolph/about.md
Programming Achievements: How to Level Up as a Developer
@jaseg
jaseg / gist:5296519
Last active March 23, 2016 10:08
zsh unicode table using only zsnexpn(1) in <140 characters

The following line produces a unicode table (decimal value and unicode characters) using only zsh * expansion, * substitution and the print-builtin.

setopt extendedglob histsubstpattern multibyte
print -ac ${${(A)=u::={5126..5743}}:s/#%(#b)(*)/'${(r:6:m)match[1]}${(#mr:4:)match[1]}'/}

Output:

@olov
olov / gist:eb60ab878eb73a7c5e22
Created October 15, 2014 08:55
listenandservetls_nossl30.go
// You don't want to serve HTTPS supporting for SSL3.0 any longer, see:
// http://googleonlinesecurity.blogspot.de/2014/10/this-poodle-bites-exploiting-ssl-30.html
import (
"crypto/tls"
"net/http"
)
// This code supports SSL3.0, TLS1.0, TLS1.1 and TLS1.2
// Chances are you currently do this but want to stop due to the POODLE
err := http.ListenAndServeTLS(addr, "crtfile", "keyfile", handler)
@kachayev
kachayev / tic-tac-toe.py
Created November 22, 2011 23:50
Tornado demo application: TCP server to tic-tac-toe multiplayer game
"""Simple TCP server for playing Tic-Tac-Toe game.
Use Player-to-Player game mode based on naming auth.
No thoughts about distribution or pub/sub mode
(for monitoring or something like this). Just
basic functionality.
"""
import time
import logging
@astanin
astanin / rmtweets.py
Created November 13, 2012 16:31
Delete tweets older than X days.
#!/usr/bin/env python2
"""Delete tweets older than X days.
Usage:
rmtweets.py [at_least_days_old (default=365)]
"""
# Twitter gives access to only the last 3200 tweets, but if you delete
# more recent tweets, then after some time (a week? a month?) the
@fsbs
fsbs / pycurl_multi_socket_action.py
Created September 16, 2019 15:13
Example of driving transfers with pycurl's multi.socket_action
import asyncio
import pycurl
import selectors
MULTI = pycurl.CurlMulti()
SELECTOR = selectors.DefaultSelector()
LOOP = asyncio.get_event_loop()
TIMER = None
@jasonwryan
jasonwryan / Install
Last active April 29, 2021 09:26
Arch Linux installation procedure for LVM on LUKS: UEFI EFISTUB boot with gumiboot on a Samsung Series 9 laptop.
# Notes for installing on Samsung Series 9
# UEFI boot: LVM on LUKS
#
# See the full blog post:
# http://jasonwryan.com/blog/2013/01/25/uefi/
# check you are booted in uefi
modprobe efivars
ls /sys/firmware/efi/vars