Skip to content

Instantly share code, notes, and snippets.

@aileftech
aileftech / hex-colors.txt
Created October 1, 2022 18:10
A Bash one-liner to produce a list of HEX color codes that read like (supposedly) valid English words
$ grep -P "^[ABCDEFabcdefOoIi]{6,6}$" /usr/share/dict/words | tr 'OoIi' '0011' | tr '[:lower:]' '[:upper:]' | awk '{print "#" $0}'
#ACAD1A
#B0BB1E
#DEBB1E
#AB1DED
#ACAC1A
#ACCEDE
#AC1D1C
#BAB1ED
#BA0BAB
@code-review-doctor
code-review-doctor / duplicate-test-names-PRs.csv
Last active February 22, 2022 11:53
duplicate-test-names pull requests
https://github.com/ansible/ansible/pull/77080
https://github.com/jazzband/django-axes/pull/848
https://github.com/django-helpdesk/django-helpdesk/pull/996
https://github.com/django-haystack/django-haystack/pull/1841
https://github.com/byteface/domonic/pull/58
https://github.com/Volontaria/API-Volontaria/pull/307
https://github.com/benwhalley/signalbox/pull/7
https://github.com/taigaio/taiga-back/pull/1619
https://github.com/The-Domecode/domecode-opensource/pull/68
https://github.com/kaleidos-ventures/taiga-back/pull/82
@Jordan-Cottle
Jordan-Cottle / slots.py
Created August 22, 2021 02:23
Quick demonstration of `__slots__` with inheritance. Subclasses are able to make their own independent decision on whether to use slots or not. Subclasses will use a dynamic `__dict__` instead of the static `__slots__` as usual, even if their parent class uses `__slots__`.
class Foo:
__slots__ = ["spam", "eggs"]
def __init__(self) -> None:
self.spam = "spam"
self.eggs = "eggs"
class Bar(Foo):
def __init__(self):
// Utils
const range = n => [...Array(n).keys()];
const add = ([x0, y0]) => ([x1, y1]) => [x0 + x1, y0 + y1];
const rotate = θ => ([x, y]) => [
Math.round(x * Math.cos(θ) - y * Math.sin(θ)),
Math.round(x * Math.sin(θ) + y * Math.cos(θ))
];
const map = f => g =>
function*() {
for (const v of g()) {
import pybullet as p
import time
usePhysX = True
if usePhysX:
p.connect(p.PhysX)
p.loadPlugin("eglRendererPlugin")
else:
p.connect(p.GUI)
@meganspeir
meganspeir / app.py
Created October 29, 2015 18:29
The Martian
import requests
from flask import Flask
from flask import request, send_from_directory
from twilio import twiml
from martianify import martianify
UPLOAD_FOLDER = '/path/to/your/project/'
# App declaration and configuration
@xdamman
xdamman / install_ffmpeg_ubuntu.sh
Created July 2, 2014 21:03
Install latest ffmpeg on ubuntu 12.04 or 14.04
#!/bin/bash
# Bash script to install latest version of ffmpeg and its dependencies on Ubuntu 12.04 or 14.04
# Inspired from https://gist.github.com/faleev/3435377
# Remove any existing packages:
sudo apt-get -y remove ffmpeg x264 libav-tools libvpx-dev libx264-dev
# Get the dependencies (Ubuntu Server or headless users):
sudo apt-get update
@willurd
willurd / web-servers.md
Last active July 8, 2025 00:19
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@SuzanaK
SuzanaK / NLTK code snippets
Created March 26, 2013 14:00
NLTK Code Snippets
# various NLTK code snippets
@stantonk
stantonk / doit
Created November 15, 2012 22:46
Install python 2.7.3 on CentOS 5.8
#!/bin/bash
# Source: http://toomuchdata.com/2012/06/25/how-to-install-python-2-7-3-on-centos-6-2/
yum groupinstall "Development tools"
yum install zlib-devel
yum install bzip2-devel openssl-devel ncurses-devel
wget http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tar.bz2
tar xf Python-2.7.3.tar.bz2
cd Python-2.7.3