Run with Python:
pip-2.7 install cffi PYTHON=python2.7 sh go.sh
Run with PyPy:
pip-pypy install cffi PYTHON=pypy sh go.sh
| #!/usr/bin/lua | |
| -- Metrics web server (0.1) | |
| -- Copyright (c) 2015 Kevin Lyda | |
| -- Apache 2.0 License | |
| socket = require("socket") | |
| netsubstat = {"IcmpMsg", "Icmp", "IpExt", "Ip", "TcpExt", "Tcp", "UdpLite", "Udp"} | |
| cpu_mode = {"user", "nice", "system", "idle", "iowait", "irq", | |
| "softirq", "steal", "guest", "guest_nice"} | |
| netdevsubstat = {"receive_bytes", "receive_packets", "receive_errs", |
| # Validate project's JSON files | |
| function vj() | |
| { | |
| if [ "$1" == "" ]; then | |
| local path="." | |
| else | |
| local path="$1" | |
| fi | |
| for json in $(find "$path" -name "*.json"); do |
Run with Python:
pip-2.7 install cffi PYTHON=python2.7 sh go.sh
Run with PyPy:
pip-pypy install cffi PYTHON=pypy sh go.sh
| # Basically the nginx configuration I use at konklone.com. | |
| # I check it using https://www.ssllabs.com/ssltest/analyze.html?d=konklone.com | |
| # | |
| # To provide feedback, please tweet at @konklone or email [email protected]. | |
| # Comments on gists don't notify the author. | |
| # | |
| # Thanks to WubTheCaptain (https://wubthecaptain.eu) for his help and ciphersuites. | |
| # Thanks to Ilya Grigorik (https://www.igvita.com) for constant inspiration. | |
| server { |
git add HISTORY.md
git commit -m "Changelog for upcoming release 0.1.1."
bumpversion patch
| import re | |
| from django.utils.text import compress_string | |
| from django.utils.cache import patch_vary_headers | |
| from django import http | |
| ''' | |
| EXAMPLE USAGE: | |
| Put this file in a directory called, eg, 'middleware,' inside your django |
| ''' | |
| Gibbs sampler for function: | |
| f(x,y) = x x^2 \exp(-xy^2 - y^2 + 2y - 4x) | |
| using conditional distributions: | |
| x|y \sim Gamma(3, y^2 +4) | |
| y|x \sim Normal(\frac{1}{1+x}, \frac{1}{2(1+x)}) | |
| ''' |
The goal of this example is to show how an existing C codebase for numerical computing (here c_code.c) can be wrapped in Cython to be exposed in Python.
The meat of the example is that the data is allocated in C, but exposed in Python without a copy using the PyArray_SimpleNewFromData numpy
| """ | |
| Visualize points on the 3-simplex (eg, the parameters of a | |
| 3-dimensional multinomial distributions) as a scatter plot | |
| contained within a 2D triangle. | |
| David Andrzejewski ([email protected]) | |
| """ | |
| import numpy as NP | |
| import matplotlib.pyplot as P | |
| import matplotlib.ticker as MT |