Skip to content

Instantly share code, notes, and snippets.

marchdown

  • Tel Aviv; Den Haag
Block or report user

Report or block marchdown

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
@jcrubino
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 http://code.activestate.com/recipes/578914-simple-linear-regression-with-pure-python/
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 <abraham@dina.kvl.dk>
;; Version: $Id: all.el,v 5.2 1997/03/04 10:29:42 abraham Exp $
;; Keywords: matching
;; LCD Archive Entry:
@syhw
syhw / dnn.py
Last active Feb 6, 2019
A simple deep neural network with or w/o dropout in one file.
View dnn.py
"""
A deep neural network with or w/o dropout in one file.
License: Do What The Fuck You Want to Public License http://www.wtfpl.net/
"""
import numpy, theano, sys, math
from theano import tensor as T
from theano import shared
from theano.tensor.shared_randomstreams import RandomStreams
@jed
jed / how-to-set-up-stress-free-ssl-on-os-x.md
Last active Jan 9, 2020
How to set up stress-free SSL on an OS X development machine
View how-to-set-up-stress-free-ssl-on-os-x.md

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

@mmcdole
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
jkrems / generators.md
Last active Feb 24, 2020
Generators Are Like Arrays
View generators.md

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.

You can’t perform that action at this time.