Skip to content

Instantly share code, notes, and snippets.

class EntryHandler(InboundMailHandler):
"""
Process inbound emails as entries into the database.
Every email is a new post. User must login to web interface
to edit any post details.
message object:
- subject
- sender
@staydecent
staydecent / wolf_layout_loader.php
Created October 6, 2010 22:00
WolfCMS Layout Loader
<?php
/**
* Loads any layout files(.php) contained inside the theme folders.
*
* @package wolf
* @subpackage plugin.layout_loader
*
* @author Adrian Unger <spam{at}staydecent.ca>
* @version 1.1
@staydecent
staydecent / functions.php
Created February 16, 2011 18:30
Function to Remove a top level admin menu (taken from WP trac)
<?php
/*
Function taken from http://core.trac.wordpress.org/changeset/15753
Awaiting release of WP 3.1.0
Credits: scribu
*/
if ( ! function_exists('remove_menu_page') ) {
/**
* Remove a top level admin menu
@staydecent
staydecent / videotimeline.js
Created April 4, 2011 20:38
video timelime events, lzimm halp mez
jQuery(document).ready(function($) {
var video = $('.video');
var vCount = 0; // Or own counter, for counting
var chapters = {
// seconds : selector
// I forget what data types JS has.... LOLZ
// Pythonz in my brain
1 : 'one-second'
@staydecent
staydecent / video_embed.php
Created October 27, 2011 05:30
Vimeo or YouTube thumb link
<?php
if (!ctype_digit($videolink)) :
// has chars other than digits == YouTube
?>
<div class="video column six<?php echo ($video_count === $last) ? ' last' : ''; ?>">
<a class="videopopup" href="http://youtube.com/v/<?php echo $videolink; ?>">
<img src="http://img.youtube.com/vi/<?php echo $videolink; ?>/0.jpg">
</a>
</div>
<?php
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Blue Component</key>
<real>0.23137255012989044</real>
<key>Green Component</key>
<real>0.18823529779911041</real>
var schemas = {};
schemas['Person'] = {};
schemas['Quote'] = {};
schemas['Invoice'] = {};
// `app` would actually be an express instance
var app = {
get: function(path, fn) {},
post: function(path, fn) {},
put: function(path, fn) {},
@staydecent
staydecent / flyd_transducer.js
Created December 8, 2015 19:10
FRP with transducers to modify stream input
var t = require('transducers.js');
var flyd = require('flyd');
var s1 = flyd.stream();
var s2 = flyd.transduce(t.compose(
t.map(function(x) { return x * 2; }),
t.dedupe()
), s1);
flyd.map(function(n) { console.log(n); }, s2);
@staydecent
staydecent / build.sh
Last active December 15, 2015 19:09
Concatenates files in a single dir. Supports before ordering and nice things.
#!/bin/bash
# Concat our shit
declare -a libsBefore
declare -a helperFiles
libsBefore=(
'jquery.min.js'
'underscore-min.js'
'backbone-min.js'
#
# The Churros
# by @staydecent
#
# combo of some fine open-source species,
# with some of the custom Dormant Penguin love
#
speed_change_fear = 60.0
my_start_pos = null