Skip to content

Instantly share code, notes, and snippets.

Avatar

Al Graham TinyExplosions

View GitHub Profile
View AnnotationView.js
define([
'underscore',
'backbone',
'text!templates/AnnotationTemplate.html',
'hammer',
'utils'
], function(_, Backbone, AnnotationTemplate, Hammer, Utils) {
var AnnotationView = Backbone.View.extend({
View AnnotationView.js
define([
'underscore',
'backbone',
'text!templates/AnnotationTemplate.html',
'hammer',
'utils'
], function(_, Backbone, AnnotationTemplate, Hammer, Utils) {
var AnnotationView = Backbone.View.extend({
View authMiddleware.js
(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');
View gist:ea035a7d2f257f367888
// 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)
View UUIDTest.js
// 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 Mar 9, 2014
Sublime Packages Installed
View packages.md
  • 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 Aug 29, 2015
Cordova Plugins auto added by FeedHenry Platform
View plugins.md
  • 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)
View .slate
# 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