Skip to content

Instantly share code, notes, and snippets.

🌈

Idan Gazit idan

🌈
Block or report user

Report or block idan

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
@bendc
bendc / functional-utils.js
Last active Sep 14, 2019
A set of pure ES2015 functions aimed to make functional JavaScript more idiomatic.
View functional-utils.js
// array utils
// =================================================================================================
const combine = (...arrays) => [].concat(...arrays);
const compact = arr => arr.filter(Boolean);
const contains = (() => Array.prototype.includes
? (arr, value) => arr.includes(value)
: (arr, value) => arr.some(el => el === value)
@mbostock
mbostock / .block
Last active Apr 22, 2019
Gist API Latency
View .block
license: gpl-3.0
@danparsons
danparsons / gist:3195652
Created Jul 29, 2012
How to stream the London 2012 Olympics
View gist:3195652

How to stream the London 2012 Olympics

There have been several HOWTOs posted regarding streaming the 2012 Olympics using HTTP / SOCKS proxies via SSH and other similar methods. None of these actually work using the latest Flash on Mountain Lion (with Firefox, Chrome or Safari). Additionally, the third-party streaming sites don't provide BBC's amazing interface, which lets you quickly skip to individual competitors and events. However, setting up an OpenVPN server does work, with some tweaks. You'll get the exact same UX that people in England receive.

@ib-lundgren
ib-lundgren / gist:2584789
Created May 3, 2012
OAuth1 using requests, OAuthLib and RSA signatures
View gist:2584789
import requests
from requests.auth import OAuth1
from oauthlib.oauth1.rfc5849 import SIGNATURE_RSA
client_key = u'...'
# You need to register your key with the OAuth provider first,
# in this case Google at https://accounts.google.com/ManageDomains
key = open("your_rsa_key.pem").read()
@idan
idan / oauthlib_twitter_example.py
Created May 2, 2012
Requests + OAuth, sample usage
View oauthlib_twitter_example.py
import requests
from requests.auth import OAuth1
url = u'https://api.twitter.com/1/account/settings.json'
client_key = u'...'
client_secret = u'...'
resource_owner_key = u'...'
resource_owner_secret = u'...'
@jacobian
jacobian / pip-cache-install.py
Created May 1, 2012
Install a package from your local pip download cache without touching the 'net.
View pip-cache-install.py
#!/usr/bin/env python
"""
Install a package from your local pip download cache without having to touch
the 'net at all.
You'll need to be using a pip download cache; that is, you'll need the
following in your ~/.pip/pip.cfg:
[install]
@datagrok
datagrok / gist:2199506
Last active Jun 27, 2019
Virtualenv's `bin/activate` is Doing It Wrong
View gist:2199506
@ryangomba
ryangomba / optics.py
Last active Jul 26, 2019
OPTICS clustering in Python
View optics.py
# Copyright (c) 2012, Ryan Gomba
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
@jezdez
jezdez / djpatch.py
Created Aug 25, 2011
A helper script to apply patches from Django's trac
View djpatch.py
#!/usr/bin/env python
"""
Obviously this is only useful if you have to deal with Django's
Trac a lot.
Mostly stolen from Jacob Kaplan-Moss, but improved by Jannis Leidel
and Aymeric Augustin.
Reads a config file at ~/.djpatchrc, e.g.:
You can’t perform that action at this time.