Skip to content

Instantly share code, notes, and snippets.



  • Jerusalem
View GitHub Profile
jcrubino / gist:347108b2541263fab6cc
Last active Aug 29, 2015
Basic Linear Regression Class and Function for Streaming and Static Data
View gist:347108b2541263fab6cc
# basic linear regression in pure python (no numpy!)
# class and function usable for streams
# refactored from
import math
def mean(series):
return sum(series) / len(series)
def standard_deviation(series, ave):
View all.el
;;; all.el --- Edit all lines matching a given regexp.
;; Copyright (C) 1985, 1986, 1987, 1992, 1994 Free Software Foundation, Inc.
;; Copyright (C) 1994 Per Abrahamsen
;; Author: Per Abrahamsen <>
;; Version: $Id: all.el,v 5.2 1997/03/04 10:29:42 abraham Exp $
;; Keywords: matching
;; LCD Archive Entry:
mmcdole / .clang-format
Created Oct 30, 2015
Objective-C Clang Format
View .clang-format
BasedOnStyle: Chromium
AlignTrailingComments: true
BreakBeforeBraces: Attach
ColumnLimit: 0
IndentWidth: 4
KeepEmptyLinesAtTheStartOfBlocks: false
ObjCBlockIndentWidth: 4
ObjCSpaceAfterProperty: true
ObjCSpaceBeforeProtocolList: true
PointerBindsToType: false
jkrems /
Last active Feb 24, 2020
Generators Are Like Arrays

In all the discussions about ES6 one thing is bugging me. I'm picking one random comment here from this io.js issue but it's something that comes up over and over again:

There's sentiment from one group that Node should have full support for Promises. While at the same time another group wants generator syntax support (e.g. var f = yield fs.stat(...)).

People keep putting generators, callbacks, co, thunks, control flow libraries, and promises into one bucket. If you read that list and you think "well, they are all kind of doing the same thing", then this is to you.

syhw /
Last active Sep 15, 2020
A simple deep neural network with or w/o dropout in one file.
A deep neural network with or w/o dropout in one file.
License: Do What The Fuck You Want to Public License
import numpy, theano, sys, math
from theano import tensor as T
from theano import shared
from theano.tensor.shared_randomstreams import RandomStreams
jed /
Last active Feb 18, 2021
How to set up stress-free SSL on an OS X development machine

How to set up stress-free SSL on an OS X development machine

One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.

Most workflows make the following compromises:

  • Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the secure flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection.

  • Use production SSL certificates locally. This is annoying