Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
# python 2.7
# modules imports - search the python documentation for mode imformation
import subprocess
import glob
import signal
import RPi.GPIO as GPIO
import random
import os
@hadees
hadees / action_mailer.rb
Last active August 29, 2015 14:07
Better way to create the crazy email Mailgun wants you to send for batch emails through SMTP.
ActionMailer::Base.register_interceptor(MailgunBatch)
gmail.com
outlook.com
zoho.com
icloud.com
yandex.mail
yahoo.com
mail.com
shortmail.com
facebook.com
myway.com
@hadees
hadees / 0_reuse_code.js
Last active August 29, 2015 14:11
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@hadees
hadees / CoffeeScript.sublime-settings
Created September 25, 2015 17:34
Sublime Settings
{
// On save last line is a eof
"ensure_newline_at_eof_on_save": true,
// On save remove trailing whitespace
"trim_trailing_white_space_on_save": true,
// Highlight current ligne, and modified tabs
"highlight_line": true,
"highlight_modified_tabs": true,
{
"user": {
"debug": false,
"delay": 0.25,
"error_color": "D02000",
"gutter_theme": "",
"gutter_theme_excludes": [],
"lint_mode": "background",
"linters": {
"annotations": {
@hadees
hadees / Module
Created July 19, 2012 19:02
Observer
module OverAchievement
def level_up(level, *args, &block)
options = args.extract_options!
options[:on] = options[:on].to_a
options[:on].each do |callback|
defined_levels[callback] ||= []
defined_levels[callback] << block
end
@hadees
hadees / gist:3758552
Created September 20, 2012 21:46
Youtube VPAID
<?xml version="1.0" encoding="UTF-8"?>
<VAST version="2.0">
<Ad id="preroll-1">
<InLine>
<AdSystem>2.0</AdSystem>
<AdTitle>5773100</AdTitle>
<Creatives>
<Creative>
<Linear>
<Duration>00:00:01</Duration>
@hadees
hadees / proxy.pac
Last active December 23, 2015 12:18
// proxy.pac
function FindProxyForURL(url, host) {
if (shExpMatch(host, "*.dev")) {
return "PROXY local:3000";
}
if (shExpMatch(host, "dev")) {
return "PROXY local:3000";
}
return "DIRECT";
}