Skip to content

Instantly share code, notes, and snippets.

View TinyExplosions's full-sized avatar

Al Graham TinyExplosions

View GitHub Profile
define([
'underscore',
'backbone',
'text!templates/AnnotationTemplate.html',
'hammer',
'utils'
], function(_, Backbone, AnnotationTemplate, Hammer, Utils) {
var AnnotationView = Backbone.View.extend({
define([
'underscore',
'backbone',
'text!templates/AnnotationTemplate.html',
'hammer',
'utils'
], function(_, Backbone, AnnotationTemplate, Hammer, Utils) {
var AnnotationView = Backbone.View.extend({
(function() {
var Auth = {},
$fh = require('fh-mbaas-api'),
Q = require('q'),
Logger = require('/util/logger').getLogger();
Auth.authenticated = function(req, res, next) {
Logger.log("debug", "Authenticating Request");
// Check for the `X-FH-Session-Token` -if it's not there, it's an unauthorised attempt
var sessionToken = req.header('X-FH-Session-Token');
// Create your new elements all in memory, saves on repaints
var $ul = $('<ul>');
for (var i = 0; i < whatever; i++) {
$ul.append('<li>Dropdown item</li>');
};
//then append to DOM when complete
$(elem).after($ul);
//trigger event, 0 should be enough to do `nextTick` sorta thing.
setTimeout($(elem).triger('dompainted'),0)
// based on http://stackoverflow.com/a/873856
var UUIDs = {};
var createUUID = function() {
// http://www.ietf.org/rfc/rfc4122.txt
var s = [];
var hexDigits = "0123456789abcdef";
for (var i = 0; i < 36; i++) {
s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);
}
@TinyExplosions
TinyExplosions / packages.md
Created March 9, 2014 12:11
Sublime Packages Installed
  • Emmet -zen coding -html autocomplete
  • Emmet Css Snippets -css snippets for autocomplete
  • File Navigator -add/edit etc from left hand drawer
  • Git -git integration
  • Git Config -config git integration
  • GitGutter -inline diff
  • GitHub Flavored Markdown Preview -text highlighting of GFM
  • Gitignore -create gitignore via boilerplate
  • HTML Boilerplate -crete html5 boilerplate
  • HTML5
@TinyExplosions
TinyExplosions / plugins.md
Last active August 29, 2015 13:57
Cordova Plugins auto added by FeedHenry Platform
  • org.apache.cordova.device (0.2.8)
  • org.apache.cordova.network-information (0.2.7)
  • org.apache.cordova.battery-status (0.2.7)
  • org.apache.cordova.device-motion (0.2.6)
  • org.apache.cordova.device-orientation (0.3.5)
  • org.apache.cordova.geolocation (0.3.6)
  • org.apache.cordova.file (0.2.5)
  • org.apache.cordova.camera (0.2.7)
  • org.apache.cordova.media (0.2.8)
  • org.apache.cordova.media-capture (0.2.7)
@TinyExplosions
TinyExplosions / .slate
Created July 31, 2013 07:30
Slate Config
# Configs
config defaultToCurrentScreen true
config nudgePercentOf screenSize
config resizePercentOf screenSize
config secondsBetweenRepeat 0.1
config checkDefaultsOnLoad true
config focusCheckWidthMax 3000
# Monitor Aliases
alias mon-laptop 1440x900