Skip to content

Instantly share code, notes, and snippets.

Nemesis Fixx mcnemesis

Block or report user

Report or block mcnemesis

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
johnhw /
Last active Apr 20, 2020
1 million prime UMAP layout
### JHW 2018
import numpy as np
import umap
# This code from the excellent module at:
import random
radekk / entropy.js
Created Jun 7, 2017
Calculating Shannon's entropy with JavaScript
View entropy.js
* Calculate Shannon's entropy for a string
module.exports = (str) => {
const set = {};
c => (set[c] ? set[c]++ : (set[c] = 1))
mcnemesis /
Last active Aug 29, 2015
This is how to upgrade your WordPress site, its plugins and themes automatically via a shell, using wp-cli
#requires: wp-cli installed
# run all the following commands inside your wordpress root directory
wp core update #updates wp itself
wp plugin update --all #update all plugins
wp theme update -all #update all themes
mcnemesis / uganda_districts.txt
Created Jun 4, 2014
List of all current (as of 2014) Uganda's Districts - useful in forms-authoring and other tasks of your liking (source :
View uganda_districts.txt
View domain-nginx.conf
server {
server_name $domain_name;
root /var/www;
index index.html index.php;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
# Cache static files for as long as possible
location ~* \.(?:xml|ogg|mp3|mp4|ogv|svg|svgz|eot|otf|woff|ttf|css|js|jpg|jpeg|gif|png|ico)$ {
try_files $uri =404;
View Python PyCrypto: Verify Signature
def verify_sign(public_key_loc, signature, data):
Verifies with a public key from whom the data came that it was indeed
signed by their private key
param: public_key_loc Path to public key
param: signature String signature to be verified
return: Boolean. True if the signature is valid; False otherwise.
from Crypto.PublicKey import RSA
from Crypto.Signature import PKCS1_v1_5
willurd /
Last active May 28, 2020
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
justincarroll / bootstrap-basic-template.htm
Last active May 11, 2018
This is my personal Bootstrap 3 and Font Awesome 4 basic HTML template.
View bootstrap-basic-template.htm
<html lang="en">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bootstrap Basic Template</title>
<link rel="stylesheet" href="">
<link rel="stylesheet" href="">
<link rel="stylesheet" href="style.css">
mems / gist:5301297
Last active Apr 23, 2020
How to convert a (simple) SWF to PDF
View gist:5301297

Convert (simple) SWF to PDF

In SWFTools a programs called gfx2gfx is available to do this task, but it's not officially available precompiled.

It can convert SWF, PDF or image to SWF, PDF, ebook or image.

For discard downscaling for rasterized image (default: 72dpi) we use the provided by @m-p-y: add -r attribute to increase maxdpi


You can’t perform that action at this time.