(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
#!/usr/bin/env python | |
# coding: utf-8 | |
# You need PIL <http://www.pythonware.com/products/pil/> to run this script | |
# Download unifont.ttf from <http://unifoundry.com/unifont.html> (or use | |
# any TTF you have) | |
# Copyright 2011 Álvaro Justen [alvarojusten at gmail dot com] | |
# License: GPL <http://www.gnu.org/copyleft/gpl.html> | |
from image_utils import ImageText |
def fizzbuzz(n): | |
if n % 3 == 0 and n % 5 == 0: | |
return 'FizzBuzz' | |
elif n % 3 == 0: | |
return 'Fizz' | |
elif n % 5 == 0: | |
return 'Buzz' | |
else: | |
return str(n) |
import sys | |
import numpy | |
import cv2 | |
def comic(img): | |
# do edge detection on a grayscale image | |
gray = cv2.cvtColor(img, cv2.COLOR_BGRA2GRAY) | |
edges = cv2.blur(gray, (3, 3)) # this blur gets rid of some noise |
#!/bin/bash | |
## Check for versions compiled with ARM at http://nodejs.org/dist/ | |
## Inspired by http://oskarhane.com/raspberry-pi-install-node-js-and-npm/ | |
## Fill in the Node Version here: | |
########################################################################## | |
NODE_VERSION="v0.10.21" |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
A personal diary of DataFrame munging over the years.
Convert Series datatype to numeric (will error if column has non-numeric values)
(h/t @makmanalp)
On a shared hosting service like dreamhost, how do you get your twitter bot up and running? Problems:
I'm still figuring this stuff out myself, so nothing is clear as it should be. Hope this page will be a resource that will improve over time.
var page = new WebPage(); | |
//spoof it as opera mini, to get the mobile page working properly | |
page.settings.userAgent = "Opera/9.80 (J2ME/MIDP; Opera Mini/6.5.26955/27.1407; U; en) Presto/2.8.119 Version/11.10"; | |
function doLogin(){ | |
page.evaluate(function(){ | |
var frm = document.getElementById("login_form"); | |
frm.elements["email"].value = "--enter-your-email--"; |
// Returns the value at a given percentile in a sorted numeric array. | |
// "Linear interpolation between closest ranks" method | |
function percentile(arr, p) { | |
if (arr.length === 0) return 0; | |
if (typeof p !== 'number') throw new TypeError('p must be a number'); | |
if (p <= 0) return arr[0]; | |
if (p >= 1) return arr[arr.length - 1]; | |
var index = (arr.length - 1) * p, | |
lower = Math.floor(index), |
extension_id=jifpbeccnghkjeaalbbjmodiffmgedin # change this ID
curl -L -o "$extension_id.zip" "https://clients2.google.com/service/update2/crx?response=redirect&os=mac&arch=x86-64&nacl_arch=x86-64&prod=chromecrx&prodchannel=stable&prodversion=44.0.2403.130&x=id%3D$extension_id%26uc"
unzip -d "$extension_id-source" "$extension_id.zip"
Thx to crxviewer for the magic download URL.