Skip to content

Instantly share code, notes, and snippets.

View jdowner's full-sized avatar

Joshua Downer jdowner

View GitHub Profile
@jdowner
jdowner / .gitignore
Last active October 6, 2016 13:06
struct augmentation
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
# C extensions
*.so
# Distribution / packaging
.Python
env/
@jdowner
jdowner / file1.txt
Created December 29, 2016 15:45
gpg public key
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1
mQINBFR1MNYBEACwF+IeDIXvKOWRHQrnuUD/OwEitWG1FgDJAe4M247pt0dkMhAP
SC14oXN57iDkjZ27W6YngSZyLDZLTvFOs4pzsSr80DB42NJo+K/TSHhtLx191O8b
gYBWERDXkBsd4lEwpWUsvc2gmJ+GrX2mQXejgDN1wbqECXi8nlGWztBOQVCXqid/
5nNWtOu/Hvr4MtxrOzyx7dmvz0A/tkpJ7m5K2gnxcEn9gxtjbgNOwsd/3yw36F7K
4YpSCMfx343xwieEmgfwncBI8uYBzOVHLcT2Ho6n+1RV8L3qMj33dNZiQ2T+u1uv
V+cvHRt9kqq+/o3LYkODNsBzVg8kJagZgiScWPqGFwxmS8+tiqfZeyYbWLPllG0N
5Dzo4Obx6PlO7FFyBpi18zIbmiykClUJysVIunNEG+Hb8/wE7vVjccG0SleWF8zJ
@jdowner
jdowner / unparse.py
Created January 15, 2017 10:23
python ast unparse
"Usage: unparse.py <path to source file>"
import sys
import ast
import cStringIO
import os
# Large float and imaginary literals get turned into infinities in the AST.
# We unparse those infinities to INFSTR.
INFSTR = "1e" + repr(sys.float_info.max_10_exp + 1)
@jdowner
jdowner / requirements.txt
Created December 24, 2017 11:31
url to text
docopt
readability-lxml
@jdowner
jdowner / Description.md
Created August 15, 2018 13:44 — forked from juanje/Description.md
Limit Chrome from eating all the memory and CPU

I was tired of Chrome eating all my laptop resources so I decided to put some limit to it with cgroup.

As I was using Ubuntu 12.04 with support for cgroup, I installed the package cgroup-bin and add the following group to the file /etc/cgconfig.conf:

group browsers {
    cpu {
#       Set the relative share of CPU resources equal to 25%
        cpu.shares = "256";
 }