Skip to content

Instantly share code, notes, and snippets.

🍕
please

James jamesplease

🍕
please
Block or report user

Report or block jamesplease

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View respond.styl
respond-to($width)
if $lg-screen is $width
media = 'all and (min-width: %s)' % $width
@media media
{block}
else
media = 'all and (max-width: %s)' % $width
@media media
{block}
@jamesplease
jamesplease / gistook.md
Last active Aug 29, 2015
The schema for Gistbook entities.
View gistook.md

A Gistbook is a JSON file. Individuals are encouraged to build applications that render the Gistbook format in a variety of ways. One example of this is Gistbook.io, which happens to be linked to Github Gists for convenience.

Gistbook

title: The name of the Gistbook
author: The author
updatedAt: The datetime that the Gistbook was last updated as an ISO8601 string
createdAt: The datetime that the Gistbook was created as an ISO8601 string
pages: An array of Pages
resources: URIs to external resources that are necessary to render the Gistbook

@jamesplease
jamesplease / appRouter.js
Created May 9, 2014
Marionette.ExpressRouter
View appRouter.js
// Set up your appRouter
var appRouter = Marionette.appRouter.extend({
controller: myController,
routes: {
// These can be an array of middleware functions
'/': [ 'authorize', 'home' ],
'/schedule/user': [ 'authorize', 'schedule', 'users' ],
// Or just one function
'/logout': 'logout'
}
@jamesplease
jamesplease / marionette.router-2.js
Last active Aug 29, 2015
A possible API for a future Marionette router.
View marionette.router-2.js
// Create our Application
var app = new Marionette.Application();
// Attach a router to it
app.router = new Marionette.Router({
channelName: 'myRouter',
states: {
'profile': {
url: 'profile',
View index.js
// within /login
// These two files exist, and are identical. They just return some arbitrary object.
// login.js & what.js
// This always returns undefined
var login = require('./login');
// This returns the object
var what = require('./what');
View state.js
define(function(require) {
var angular = require('angular');
angular.module('auth').config([
'$stateProvider', '$urlRouterProvider',
function($stateProvider, $urlRouterProvider) {
$stateProvider
.state('portal.login', {
url: '/login',
templateUrl: '/modules/auth/login.html',
@jamesplease
jamesplease / radio.shim.js
Last active Nov 17, 2018
A shim to replace Backbone.Wreqr with Backbone.Radio in Marionette. Requires Marionette v2.1+
View radio.shim.js
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
define(['backbone.marionette', 'backbone.radio', 'underscore'], function(Marionette, Radio, _) {
return factory(Marionette, Radio, _);
});
}
else if (typeof exports !== 'undefined') {
var Marionette = require('backbone.marionette');
var Radio = require('backbone.radio');
var _ = require('underscore');
View latex-unicode.json
{
"mathexclam": { "unicode": "00021", "type": "mathpunct", "desc": "exclamation mark" },
"mathoctothorpe": { "unicode": "00023", "type": "mathord", "desc": "number sign" },
"mathdollar": { "unicode": "00024", "type": "mathord", "desc": "dollar sign" },
"mathpercent": { "unicode": "00025", "type": "mathord", "desc": "percent sign" },
"mathampersand": { "unicode": "00026", "type": "mathord", "desc": "ampersand" },
"lparen": { "unicode": "00028", "type": "mathopen", "desc": "left parenthesis" },
"rparen": { "unicode": "00029", "type": "mathclose", "desc": "right parenthesis" },
"mathplus": { "unicode": "0002B", "type": "mathbin", "desc": "plus sign b:" },
"mathcomma": { "unicode": "0002C", "type": "mathpunct", "desc": "comma" },
@jamesplease
jamesplease / ams-symbols.js
Created Sep 27, 2014
The list of new KaTeX symbols.
View ams-symbols.js
module.exports = [
// Mathjax only
'\\square',
'\\Box',
'\\Diamond',
'\\yen',
'\\doublecap',
'\\doublecup',
'\\boxtimes',
@jamesplease
jamesplease / gistbook.json
Last active Aug 29, 2015
Gistbook New Features
View gistbook.json
{"title":"Gistbook New Features","author":"jmeas","pages":[{"pageName":"","sections":[{"type":"text","source":"This is where I test new features.\n\n:tada:"},{"type":"text","source":"Hello friend\n"},{"type":"html","source":"<div>ok</div>"},{"type":"javascript","source":"var _ = require('underscore');\nvar $ = require('jquery');\nvar Backbone = require('backbone');\nBackbone.$ = $;\n\n_.each([1,2,3], function(num) {\n console.log('ok!', num);\n});"}]}],"public":true}
You can’t perform that action at this time.