Skip to content

Instantly share code, notes, and snippets.

View endolith's full-sized avatar
😑

endolith

😑
View GitHub Profile
@XP1
XP1 / Disable Google Search rewrite 1.01.js
Created February 9, 2012 14:05
Disable Google Search rewrite: Disables the rewrite of links in Google Search results.
// ==UserScript==
// @name Disable Google Search rewrite
// @version 1.01
// @description Disables the rewrite of links in Google Search results.
// @author XP1 (https://github.com/XP1/)
// @namespace https://gist.github.com/1780197/
// @include http*://google.*/search?*
// @include http*://*.google.*/search?*
// ==/UserScript==
@WarrenWeckesser
WarrenWeckesser / create_sample24.py
Created November 14, 2013 05:05
A couple functions for generating wav files with a 3 byte sample width.
# create_sample24.py
# Author: Warren Weckesser
# License: BSD 3-Clause (http://opensource.org/licenses/BSD-3-Clause)
import numpy as np
import wave
def create_sample():
# 27 bytes (1 channel, 9 frames, 3 bytes per frame)
@ComFreek
ComFreek / so-list.user.js
Last active July 30, 2016 15:44
Additional list toolbar button for StackOverflow editor windows (note: as an answer to the following question: http://softwarerecs.stackexchange.com/q/2833/583)
// ==UserScript==
// @name StackOverflow List Button
// @description Additional list toolbar button for StackOverflow editor windows
// @version 1.0
//
// @match *://stackoverflow.com/*
// @match *://meta.stackoverflow.com/*
// @match *://pt.stackoverflow.com/*
//
// @match *://serverfault.com/*
@danielballan
danielballan / leheny.mplstyle
Last active August 3, 2016 14:13
Leheny Lab "House Style" for Python matplotlib plots
# This is Dan Allan's setting of Professor Robert Leheny's plotting style preferences.
# Updated October 2014
#
# Invoke in Python matplotlib like so:
#
# import matplotlib as mpl
#
# mpl.style.use('https://gist.github.com/danielballan/be066529de85e87a5fe7/raw')
#
# This feature is only available in matplotlib version 1.4 or higher.
@quark-zju
quark-zju / tango-colors.css.scss
Created April 17, 2014 01:49
Tango colors (SCSS)
// Highlight Shadow
// Aluminium #eeeeec #d3d7cf #babdb6
// Butter #fce94f #edd400 #c4a000
// Chameleon #8ae234 #73d216 #4e9a06
// Orange #fcaf3e #f57900 #ce5c00
// Chocolate #e9b96e #c17d11 #8f5902
// Sky Blue #729fcf #3465a4 #204a87
// Plum #ad7fa8 #75507b #5c3566
// Slate #888a85 #555753 #2e3436
// Scarlet Red #ef2929 #cc0000 #a40000
@rwilcox
rwilcox / installing_python_packages_programatically.py
Created December 26, 2010 17:32
How to use PIP to install Python packages programmatically.py
#!/usr/bin/env python
"""
PIP can stand for PIP Installs packages Programmatically, too!
(and here's how)
Requires:
* Python 2.6 or higher (for print-as-a-function)
* PIP 0.8.2
"""
@tkf
tkf / mplonflask.py
Created October 19, 2011 21:04
matplotlib on Flask
import matplotlib
matplotlib.use('Agg')
from matplotlib import pyplot
import numpy
from flask import Flask, send_file
from cStringIO import StringIO
app = Flask(__name__)
@andreasvc
andreasvc / cartpi.py
Last active March 29, 2017 02:33
Get the cartesian product of an arbitrary number of iterables, including infinite sequences.
def cartpi(seq):
""" A depth-first cartesian product for a sequence of iterables;
i.e., all values of the last iterable are consumed before advancing the
preceding ones. Like itertools.product(), but supports infinite sequences.
>>> from itertools import islice, count
>>> list(islice(cartpi([count(), count()]), 9))
[(0, 0), (0, 1), (0, 2), (0, 3), (0, 4), (0, 5), (0, 6), (0, 7), (0, 8)]
"""
if seq:
@nbeuchat
nbeuchat / draw_neural_net.py
Last active January 22, 2018 17:04 — forked from craffel/draw_neural_net.py
Draw a neural network diagram with matplotlib!
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Modified on Mon Oct 10 23:29:41 2016
@author: craffel, edited by nbeuchat (Nicolas Beuchat)
"""
import matplotlib.pyplot as plt
@theScinder
theScinder / draw_neural_net.py
Last active January 22, 2018 17:04 — forked from craffel/draw_neural_net.py
Draw a neural network diagram with matplotlib!
import matplotlib.pyplot as plt
def draw_neural_net(ax, left, right, bottom, top, layer_sizes,Theta0,Theta1):
'''
Public Gist from craffel
https://gist.github.com/craffel/2d727968c3aaebd10359
Draw a neural network cartoon using matplotilb.
I (theScinder) modified the function to accept neural network weights and adjust connection line widths accordingly, in order to create an animation of NN learning