Skip to content

Instantly share code, notes, and snippets.

View cadecairos's full-sized avatar

Christopher DeCairos cadecairos

View GitHub Profile
@cadecairos
cadecairos / gist:3859945
Created October 9, 2012 16:40
Cornfield config
{
"server" : {
"bindIP" : "localhost",
"bindPort" : "8888"
},
"logger" : {
"format" : "dev"
},
"session" : {
"secret": "thisisareallyreallylongsecrettoencryptcookies",
@cadecairos
cadecairos / USStrings
Created October 30, 2012 19:37
User Agent Strings
Firefox 16:
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:16.0) Gecko/20100101 Firefox/16.0"
Chrome 22:
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.94 Safari/537.4"
Safari 6.0.1:
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/536.26.14 (KHTML, like Gecko) Version/6.0.1 Safari/536.26.14"
Opera 12.02:
function renderPage( options, page ) {
var canvas = options.__canvas,
ctx = canvas.getContext( "2d" ),
viewport = page.getViewport( 1, 0 ),
wActual = options.__wrapperDiv.clientWidth,
hActual = options.__wrapperDiv.clientHeight,
wRatio,
hRatio,
ratio;
Popcorn.plugin( "foo", function() {
return {
_setup: function( options ) {
options.toString = function() {
console.log( options.text )
};
},
_update: function( trackEvent, options ) {
trackEvent.text = options.text;
}
@cadecairos
cadecairos / index.html
Created December 5, 2012 18:19
A CodePen by Christopher De Cairos. Popcorn.js Update bug - Options do not update if there's no explicit setup method (i.e. the google map plugin style of plugin definition)
<div id="foo">LOOK IN YOUR CONSOLE, BRO</div>
@cadecairos
cadecairos / popfingcorn.json
Created January 7, 2013 21:52
POP F***ING CORN JSON
{
"targets": [{
"id": "Target0",
"name": "video-container",
"element": "video-container"
}],
"media": [{
"id": "Media0",
"name": "Media0",
"url": ["http://benmoskowitz.com/popmeme/popfuck.ogg", "http://benmoskowitz.com/popmeme/popfuck.mp3"],
{
"root": "popcorn-js",
"js": {
"core": {
"path:": "popcorn.js"
},
"applyclass": {
"depends": "core",
"path": "effects/applyclass/popcorn.applyclass.js"
},
Date: Mon Mar 18 2013
App URL: http://popcorn-dev.rekambew.org/templates/basic/
Script URL: http://popcorn-dev.rekambew.org/src/butter.js:24016
Media URL(s): #t=,30
Error: NotFoundError: Node was not found
Butter State: mediaready, ready, trackadded, mediacontentchanged
Browser: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:19.0) Gecko/20100101 Firefox/19.0
Null DOM Nodes: [data-tooltip], twitter-wjs, google-plus, [data-tooltip], I0_1363630865820
Versions: Popcorn=@VERSION, Butter=v1.0.20-35-g5f4d5bf
Project Data:
diff --git a/routes/index.js b/routes/index.js
index 2e08b35..0207cdd 100644
--- a/routes/index.js
+++ b/routes/index.js
@@ -106,72 +106,73 @@ module.exports = function routesCtor( app, User, filter, sanitizer, stores, util
app.post( '/api/project/:id?',
filter.isLoggedIn, filter.isStorageAvailable,
function( req, res ) {
-
- var files;
@cadecairos
cadecairos / HawkMiddleware.js
Created July 25, 2013 16:17
MakeAPI Hawk middleware
function (req, res, next) {
/* Hawk does all the necessaries in this authenticate function.
* You pass it a function to look up an ID ( In the MakeAPI I call
* them public keys, as they are randomly generated UUIDs
*/
hawkModule.Hawk.server.authenticate(req, function (publickey, callback) {
/* Create a credentials object, This contains the algorithm that should
* be used to calculate the MAC It also contains the public key and will