- http://requirebin.com?gist=maxogden/9576573
- http://requirebin.com?gist=hughsk/5941408
- http://requirebin.com?gist=hughsk/6031068
- http://requirebin.com?gist=maxogden/9576699
- http://requirebin.com?gist=maxogden/9576799
- http://requirebin.com?gist=maxogden/9576995
- http://requirebin.com?gist=maxogden/5953535&q=level
- http://requirebin.com?gist=maxogden/9425656
This file contains 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
#include <stdio.h> | |
#define SQ(x) (x)*(x) | |
#define M0(x,y) SQ(x)+SQ(y)<4?0:0xe0 | |
#define M1(x,y,x0,y0) (SQ(x)+SQ(y)<4)?M0(SQ(x)-SQ(y)+(x0),2*(x)*(y)+(y0)):0xc0 | |
#define M2(x,y,x0,y0) (SQ(x)+SQ(y)<4)?M1(SQ(x)-SQ(y)+(x0),2*(x)*(y)+(y0),x0,y0):0xa0 | |
#define M3(x,y,x0,y0) (SQ(x)+SQ(y)<4)?M2(SQ(x)-SQ(y)+(x0),2*(x)*(y)+(y0),x0,y0):0x80 | |
#define M4(x,y,x0,y0) (SQ(x)+SQ(y)<4)?M3(SQ(x)-SQ(y)+(x0),2*(x)*(y)+(y0),x0,y0):0x60 | |
#define M5(x,y,x0,y0) (SQ(x)+SQ(y)<4)?M4(SQ(x)-SQ(y)+(x0),2*(x)*(y)+(y0),x0,y0):0x40 |
This file contains 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 numpy as np | |
import matplotlib.pyplot as plt | |
import scipy.stats as scs | |
def z_val(sig_level=0.05, two_tailed=True): | |
"""Returns the z value for a given significance level""" | |
z_dist = scs.norm() | |
if two_tailed: | |
sig_level = sig_level/2 | |
area = 1 - sig_level |
This file contains 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
#!/usr/bin/env python | |
"""python-xlib example which reacts to changing the active window/title. | |
Requires: | |
- Python | |
- python-xlib | |
Tested with Python 2.x because my Kubuntu 14.04 doesn't come with python-xlib | |
for Python 3.x. |
This file contains 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
#!/bin/bash | |
mkdir ./cgi-bin/ | |
cp upload.cgi ./cgi-bin/ | |
chmod +x ./cgi-bin/upload.cgi | |
mkdir ./upload/ | |
python -m CGIHTTPServer 8080 |
This file contains 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
# ACCESS CONTROLS OPTIONS | |
# ==================== | |
# | |
acl QUERY urlpath_regex -i cgi-bin \? \.php$ \.asp$ \.shtml$ \.cfm$ \.cfml$ \.phtml$ \.php3$ localhost | |
acl all src | |
acl localnet src 10.0.0.0/8 | |
acl localnet src 192.168.5.0/24 # Your network here | |
acl localhost src 127.0.0.1/32 | |
acl safeports port 21 70 80 210 280 443 488 563 591 631 777 901 81 3128 5000 1025-65535 | |
acl sslports port 443 563 81 2087 10000 |
This file contains 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 os | |
import gdata | |
import atom | |
import gdata.contacts | |
import gdata.contacts.service | |
import dataset | |
import requests | |
from lxml import html | |
from urlparse import urljoin, parse_qs |
This file contains 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
#!/bin/sh | |
# | |
# Simple XDG Install Script for Linux Games | |
# | |
# Features: | |
# - Communicates with the desktop via the xdg-utils vendor integration scripts. | |
# (No need to upgrade if the implementation details change.) | |
# - Icons are resolved via the desktop theming system, granting theme | |
# developers the ability to provide customized versions which preserve the | |
# overall system aesthetic. |
NewerOlder