Skip to content

Instantly share code, notes, and snippets.

View devinrhode2's full-sized avatar
😀

Devin Rhode devinrhode2

😀
View GitHub Profile
Film(array(
'filmNumber' => $filmNumber++,
'title' => 'Low: You May Need A Murderer',
'showing' => 'Thursday, June 31/7:00 PM/ Zinema',
'director' => 'David Kleijwegt',
/*'youtubeURL' => 'http://youtu.be/sToFE8jYcFM',*/
'bottomNotice' => 'One screening only, anticipated to sell-out; tickets must be purchased online at cinemapurgatorio.com/murderer',
'fullDescription' => "<p>Duluth band Low has been blessed by many films over the years, with fine work from Marc Gartman, Sebastian Schrade, Phil Harder, and others. But one film stands above the pack. You May Need a Murderer, directed by Dutchman David Kleijwegt, is both the best film about Low and one of the best films about Duluth.</p>
<p>Shot for Dutch television around 2006, You May Need a Murderer catches Low in a post-apocalyptic haze. \"The Great Destroyer\" era, with its songs about going deaf and walking into the sea, its canceled tours and other drama, has passed. What now?</p>
@devinrhode2
devinrhode2 / Better-createElement.js
Created June 5, 2012 22:36
A better createElement function, that takes a map of
//turns this:
var button = document.createElement('img');
button.src = 'images/button.png';
button.id = 'button';
button.className = 'button';
//to this:
var button = $.createElement('img', {
src: 'images/button.png',
id: 'button',
@devinrhode2
devinrhode2 / complaint.js
Created June 12, 2012 06:52
Complain to google
if (tab.url.has('://chrome.google.com/webstore')) {
if (confirm('Google blocks extensions from working on the WebStore. Press OK to send a complaint to Google.')) {
chrome.tabs.create({
'url': 'http://support.google.com/chrome_webstore/bin/request.py?contact_type=cws_user_contact'
});
}
}
//nuff said.
@devinrhode2
devinrhode2 / W...ks
Created June 14, 2012 09:48
Some pretty interesting native objects
WebSocket.prototype
WebSocket
CLOSED: 3
CLOSING: 2
CONNECTING: 0
OPEN: 1
addEventListener: function addEventListener() { [native code] }
close: function close() { [native code] }
constructor: function WebSocket() { [native code] }
dispatchEvent: function dispatchEvent() { [native code] }
@devinrhode2
devinrhode2 / better-strict-mode-pattern.js
Created June 30, 2012 19:42
Better strict mode pattern.
/* Author: username (email@me.com) */
//'globals':
var foo, bar;
(function myCodeFileJS(){
'use strict';
foo = 'asdf';
//private:
var baz = 'adsf';
}());
@devinrhode2
devinrhode2 / update-your-mustache.js
Created July 8, 2012 20:25
Why not hookup mustache templates to auto-update?
/* by Devin Rhode (@Devinrhode2)
Mustache templates are a one-time operation.
I realized this doesn't have a to be, and having them auto-update is *extremely trivial*
So, we have this mustache:
<p>Hello, {{username}}</p>
@devinrhode2
devinrhode2 / xhtml.1.1.strict.doctype.html
Created July 11, 2012 00:50
Reminder to try XHTML 1.1 Strict sometime
//XHTML 1.0 Strict DTD. No deprecated tags are supported and the code must be written correctly.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
//XHTML 1.1 - may or may not need xml tag at start...
<!DOCTYPE html PUBLIC
@devinrhode2
devinrhode2 / fallback-node-require.js
Created July 15, 2012 07:01
have require('file.js') fallback to trying require(./file.js')
/*
let's say you have some js file in your root. It's natural to expect this to work:
require('thing.js');
but it fails, reporting the module isn't available.
...but if it fails, why not check if it's at the root of the directory?
The below code overrides and wraps node's require function to do just that.
*/
var normalRequire = require;
@devinrhode2
devinrhode2 / a-idea.markdown
Created July 15, 2012 18:37
inline docs aren't a good idea. know what's a good idea? inline ghm.

/** @render-ghm

render-ghm.js

meta

@author devinrhode2 (devinrhode2@gmail.com)

-> Pause. Actually.. the author is all handled by git.

-> I see inline docs as a super easy to do documentation. With this idea, literally docs are one in the same as your project directory. You browse the documentation by browsing the project source.

@devinrhode2
devinrhode2 / Hospitals.example.js
Created July 18, 2012 08:21
Example enclosure pattern
/**
* Hospitals.js example
* by DevinRhode2
*/
//'globals':
var Hospitals = {};
(function(){
'use strict';
//not global:
var index = 0;