Skip to content

Instantly share code, notes, and snippets.

View Mebus's full-sized avatar
😀

Mebus Mebus

😀
View GitHub Profile
@Mebus
Mebus / kwacros.py
Last active March 18, 2017 17:16 — forked from skyl/kwacros.py
Django Template macros with args and kwargs
#
# templatetags/kwacros.py - Support for macros in Django templates
#
# Based on snippet by
# Author: Michal Ludvig <michal@logix.cz>
# http://www.logix.cz/michal
#
# modified for args and kwargs by Skylar Saveland http://skyl.org
#
// Written by Nick Gammon
// February 2011
/**
* Send arbitrary number of bits at whatever clock rate (tested at 500 KHZ and 500 HZ).
* This script will capture the SPI bytes, when a '\n' is recieved it will then output
* the captured byte stream via the serial.
*/
#include <SPI.h>
// Written by Nick Gammon
// February 2011
/**
* Send arbitrary number of bits at whatever clock rate (tested at 500 KHZ and 500 HZ).
* This script will capture the SPI bytes, when a '\n' is recieved it will then output
* the captured byte stream via the serial.
*/
#include <SPI.h>
@Mebus
Mebus / sc-dl.js
Created April 13, 2012 19:21
Bookmarklet that generates download link for a Soundcloud upload
(function(b) {
var a = b.createElement("a");
var s = b.createElement("span");
s.innerText = "Download";
a.appendChild(s);
a.href="http://media.soundcloud.com/stream/"+b.querySelector("#main-content-inner img[class=waveform]").src.match(/\.com\/(.+)\_/)[1];
a.setAttribute("class", "pl-button");
a.setAttribute("style", "background-image: url(http://soundcloud.com/images/icons_mini.png?unicorn26); background-repeat: no-repeat; padding-left: 18px; background-position: -77px -236px;");
a.download = b.querySelector("em").innerText+".mp3";
b.querySelector(".primary").appendChild(a);