Skip to content

Instantly share code, notes, and snippets.

View mplatts's full-sized avatar

Matt Platts mplatts

View GitHub Profile
@mplatts
mplatts / gist:a274e699b88538df4b63fb66c46af663
Created May 5, 2020 20:47 — forked from pitch-gist/gist:2999707
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@mplatts
mplatts / backbone_testing.coffee
Last active June 20, 2019 13:36
Backbone Testing Cheatsheet
# Libraries used:
# jasmine
# jasmine-jquery
# jasmine-sinon
# sinon
##### Basics Overview #####
describe "APP_NAME.Views.VIEW_FOLDER.VIEW_NAME ", ->
beforeEach ->
@mplatts
mplatts / contacts.rb
Last active February 20, 2017 22:48
Rest properties fields
{
:alpha => "WILL L", # user.rest_alpha ?
:name => "Lynne Williams", # user.first_name, user.last_name
:leasename => "Lynne Williams", # ???
:leaseshortname => "Lynne Williams", # ???
:postalline1 => "27B Fisher Avenue", # user.address_line_one
:postalline3 => "Southport Qld 4215", # user.address_line_two
:tenantsuburb => "Southport", # user.suburb
:tenantstate => "Qld", # user.state
:tenantpcode => 4215, # user.postcode
@mplatts
mplatts / games.coffee
Last active April 10, 2016 20:34
templates2 - 1
# lib/collections/games.coffee
@Games = new Mongo.Collection('games')
@mplatts
mplatts / games.coffee
Last active April 10, 2016 20:33
templates2 - 3
# client/views/games.coffee
Template.games.helpers
games: -> Games.find()
@mplatts
mplatts / games.coffee
Last active April 10, 2016 20:31
templates2 - games.coffee
# client/views/games.coffee
Template.games.helpers
teams: -> Teams.find()
games: -> Games.find()
creating: -> Session.get 'creating-game'
Template.games.events
"click .create": (e, tpl) ->
e.preventDefault()
// Usage:
//
// var video = videojs('video_id');
// video.iframeSeek();
//
// To start the player at 30s
// $iframe[0].contentWindow.postMessage('startTime:30', '*')
//
(function(window, videojs) {
@mplatts
mplatts / q-learn-coin-rules.json
Created August 27, 2013 13:22
Proposed ruleset for how many coins should be issued for certain events/scenarios in q-learn apps
{
"login": {
"firstForDay": {
"coins": 1000,
"message": "First login for the day!"
},
"firstEver": {
"coins": 10000,
"message": "First login"
}
// if we keep using Object.create(parent), we might want the parent to
// have a constructor function so all children turn out the same
parent = {
constructor: function(name) {
this._name = name;
}
}
child1 = Object.create(parent);
@mplatts
mplatts / index.html
Created October 30, 2012 05:20
Backbone Layout Manager Simple Example
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script src="https://raw.github.com/documentcloud/underscore/master/underscore.js"></script>
<script src="https://raw.github.com/documentcloud/backbone/master/backbone.js"></script>
<script src="https://raw.github.com/tbranyen/backbone.layoutmanager/master/backbone.layoutmanager.js"></script>
</head>
<body>
<div id="app"></div>