(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.
# SSL self signed localhost for rails start to finish, no red warnings. | |
# 1) Create your private key (any password will do, we remove it below) | |
$ openssl genrsa -des3 -out server.orig.key 2048 | |
# 2) Remove the password | |
$ openssl rsa -in server.orig.key -out server.key |
class SignalModel(models.Model): | |
"""A Model mixin class that lets you put your signal handler methods back into your Model class.""" | |
@classmethod | |
def _sig_pre_delete(cls, instance, *args, **kwargs): | |
"""dispatch the pre_delete method to a regular instance method. """ | |
return instance.sig_pre_delete(*args, **kwargs) | |
@classmethod | |
def _sig_post_delete(cls, instance, *args, **kwargs): |
# coding: utf-8 | |
import pprint | |
import pandas as pd | |
from rescuetime.api.service import Service | |
from rescuetime.api.access import AnalyticApiKey | |
s = Service.Service() | |
k = AnalyticApiKey.AnalyticApiKey(open('rt_key').read(), s) | |
p = {} |
/* paste into http://script.google.com | |
run periodically (e.g. every 5 minutes) with a timer by selecting 'Resources' > 'current project's triggers...' | |
*/ | |
function filterLongEmails() { | |
var num_messages = 1; // will be applied to the last n messages. Google allows up to 500 | |
var word_limit = 50; | |
var subj = "Shorter emails will get read."; | |
var body = "Dear friends, I value my time and yours but I appreciate it if you can keep your emails under " + word_limit + " words. Please edit and resend."; | |
#/usr/local/bin/python | |
"""Build Rescuetime Graph Data for StatusBoard.app | |
This script pulls data from a rescuetime account and flattens it into a format | |
that is easily read by StatusBoard. Okay. Run it with cron or launchd, whatever. | |
*nick wolfe | |
http://nameremoved.com/ | |
""" |
#!/usr/bin/env python2 | |
'''Serving dynamic images with Pandas and matplotlib (using flask).''' | |
import matplotlib | |
matplotlib.use('Agg') | |
import matplotlib.pyplot as plt | |
import numpy as np | |
import pandas as pd | |
from cStringIO import StringIO |
docker ps | awk {' print $1 '} | tail -n+2 > tmp.txt; for line in $(cat tmp.txt); do docker kill $line; done; rm tmp.txt |
/* ******************************************************************************************* | |
* THE UPDATED VERSION IS AVAILABLE AT | |
* https://github.com/LeCoupa/awesome-cheatsheets | |
* ******************************************************************************************* */ | |
// 0. Synopsis. | |
// http://nodejs.org/api/synopsis.html |
(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.
/* | |
This script, when used with Google Apps Scripts, will delete 400 emails and | |
can be triggered to run every few minutes without user interaction enabling you | |
to bulk delete email in Gmail without getting the #793 error from Gmail. | |
Google returns a maximum of 500 email threads in a single API call. | |
This script fetches 400 threads in case 500 threads is causing timeouts | |
Configure the search query in the code below to match the type of emails | |
you want to delete |