This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// resuable shortcut for module definition that works in Node (cjs) and the browser (Requirejs) | |
// (to save boilerplate may consider making umd function a global var - I know, I know!) | |
var umd = function (root, dependencies, factory) { | |
var requiredDependencies = []; | |
if (typeof define === 'function' && define.amd) { | |
define(dependencies, factory); | |
} else if (typeof exports === 'object') { | |
for (var i = dependencies.length - 1; i >= 0; i--) { | |
dependencies[i] = require(dependencies[i]); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// simple path observing | |
function O(original, parentsWatcher, path) { | |
this.original = original; | |
this.path = path; | |
this.parentsWatcher = parentsWatcher; | |
Object.observe(this.original, function(changes) { | |
changes.forEach(function(change) { | |
if((change.type === 'add' || change.type === 'update') && typeof this.original[change.name] === "object") { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// remove splash screen | |
navigator.splashscreen.hide(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.twoStopGrad(@one, @two) { | |
background: @one; /* Old browsers */ | |
background: -moz-linear-gradient(top, @one 0%, @two 100%); /* FF3.6+ */ | |
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,@one), color-stop(100%,@two)); /* Chrome,Safari4+ */ | |
background: -webkit-linear-gradient(top, @one 0%,@two 100%); /* Chrome10+,Safari5.1+ */ | |
background: -o-linear-gradient(top, @one 0%,@two 100%); /* Opera11.10+ */ | |
background: -ms-linear-gradient(top, @one 0%,@two 100%); /* IE10+ */ | |
filter: ~"progid:DXImageTransform.Microsoft.gradient( startColorstr='@one', endColorstr='@two',GradientType=0 )"; /* IE6-9 */ | |
background: linear-gradient(top, @one 0%,@two 100%); /* W3C */ | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.animate (@name, @duration: 1s, @count: infinite, @direction: normal, @function: ease-in-out) { | |
-moz-animation-name: @name; | |
-moz-animation-duration: @duration; | |
-moz-animation-iteration-count: @count; | |
-moz-animation-direction: @direction; | |
-moz-animation-timing-function: @function; | |
-webkit-animation-name: @name; | |
-webkit-animation-duration: @duration; | |
-webkit-animation-iteration-count: @count; | |
-webkit-animation-direction: @direction; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function InactivityTimer() { | |
this.timer = 0; | |
this.threshold = 5000; | |
window.addEventListener('click', this.resetTimer.bind(this), true); // binding to capture phase | |
this.startTimer.call(this); | |
} | |
InactivityTimer.prototype = { | |
startTimer: function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* { | |
/* hides the cursor */ | |
cursor:none !important; | |
/* prevent content selection */ | |
-webkit-user-select: none; | |
-khtml-user-select: none; | |
-moz-user-select: none; | |
-ms-user-select: none; | |
-o-user-select: none; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var TodoListView = Backbone.View.extend({ | |
tagName: "ul", | |
id: "todolist", | |
initialize: function() { | |
_.bindAll(this, "appendTodo"); | |
}, | |
render: function() { | |
this.$el.empty(); | |
this.collection.each(this.appendTodo); | |
return this; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nav#primary { | |
ul { | |
li { | |
a { | |
&:hover { | |
} | |
} | |
// context | |
&.home { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs') | |
const path = require('path') | |
const casual = require('casual') | |
const { makeExecutableSchema, addMockFunctionsToSchema } = require('graphql-tools') | |
const { graphql } = require('graphql') | |
fs.readFile(path.join(__dirname, './schema.graphql'), (error, schemaBuffer) => { | |
const schemaString = schemaBuffer.toString() | |
const schema = makeExecutableSchema({ | |
typeDefs: schemaString |
OlderNewer