Skip to content

Instantly share code, notes, and snippets.

View parkerproject's full-sized avatar

Parker parkerproject

View GitHub Profile
/* F.A.Q */
div { position: relative; }
input[type=checkbox] {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
opacity: 0;
@parkerproject
parkerproject / app.js
Created December 12, 2012 20:35 — forked from bryanwillis1/app.js
Back bone server JS
/*
** Client side - /public/src/app.js
*/
var myApp = {
// Collections
Collections: {
list: Backbone.Collection.extend()
},
// Views
// Is the passed CSS property supported?
// eg. detectCSS('transition')
function detectCSS(prop){
var
prop = prop.replace(/-(\w)/g,function(s,g){return g.toUpperCase()}),
pre = ',Icab,Khtml,Moz,Ms,O,Webkit'.split(',');
for (var i = 0; i < pre.length; ++i){
if(i==1)
prop = prop.slice(0,1).toUpperCase() + prop.slice(1);
// JS Module Pattern:
// http://j.mp/module-pattern
// Redefine: $, window, document, undefined.
var APP = (function($, window, document, undefined) {
// Automatically calls all functions in APP.init
$(document).ready(function() {
APP.go();
});
h2 Hello World
h3 Hello World
:markdown
This is some **test** markdown text
we can even link to [stuff](http://google.com)
ul.list
- each i in data
li=i.name
/*! ******************************
Handlebars helpers
*******************************/
// debug helper
// usage: {{debug}} or {{debug someValue}}
// from: @commondream (http://thinkvitamin.com/code/handlebars-js-part-3-tips-and-tricks/)
Handlebars.registerHelper("debug", function(optionalValue) {
console.log("Current Context");
console.log("====================");
// bootstrap
PX.app = new PX.App();
Backbone.history.start();
var importio = require('import-io').client,
fs = require('fs'),
sha1 = require('sha1'),
http = require('http-get');
// importio configuration
var userGuid = 'YOUR_USER_GUID';
var apiKey = 'YOUR_API_KEY';
var io = new importio(userGuid,
apiKey,
/*jshint strict:false*/
/*global CasperError console phantom require*/
/**
* grab links and push them into xml
*/
var casper = require("casper").create({
});
var system = require('system');
if (system.args.length < 5) {
console.info("You need to pass in account name, username, password, and path to casperJS as arguments to this code.");
phantom.exit();
}
var account = system.args[1];
var username = system.args[2];
var password = system.args[3];