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
// Usage: | |
// | |
// 1. Put this in the file that gets first loaded by RequireJS | |
// 2. Once the page has loaded, type window.rtree.map() in the console | |
// This will map all dependencies in the window.rtree.tree object | |
// 3. To generate UML call window.rtree.toUml(). The output can be used | |
// here: http://yuml.me/diagram/scruffy/class/draw | |
requirejs.onResourceLoad = function (context, map, depMaps) { | |
if (!window.rtree) { | |
window.rtree = {}; |
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
/* This is a small sampling of the various approaches to media queries. The | |
point is: they're all over the board. Part of the "issue" (if you can call | |
it that) may be due to the intended audience of each site/framework. Another | |
may be that it's really difficult to test for a lot of different devices. | |
Regardless, it would be really nice if there was standard baseline that | |
could be used as a starting point for maximum compatibility and coverage. */ | |
/* ========================================================================== | |
Frameworks | |
========================================================================== */ |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge" /> | |
<title>Poor Man's React</title> | |
<link rel="stylesheet" href="./css/styles.css" /> | |
</head> | |
<body> |
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
fs = require('fs') | |
# Transform sentence case to a filename | |
fileize = (date, title, extension) -> | |
characters = /("|'|!|\?|:|\s\z)/ig | |
whitespace = /\s/ig | |
"#{date}-#{title.replace(characters, '').replace(whitespace, '-').toLowerCase()}.#{extension}" | |
module.exports = (grunt) -> | |
grunt.initConfig |
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 acc = 810092048; | |
var aMillion = 1000000; | |
var number = 1; | |
var log = function(value) { | |
console.log(value); | |
}; | |
function bitwiseFizzBuzz(i) { | |
var c = acc & 3, a = 'fizzbuzz'; |
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
class List | |
constructor: () -> | |
# A list of pointers | |
@items = [] | |
# Objects passed in by pointer | |
@objects = {} | |
# Returns the number of objects in the list | |
count: () -> |
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
<!DOCTYPE html> | |
<html ng-app="storyTime"> | |
<head> | |
<title>Story time</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet"> | |
<style>body {padding: 50px;} .navbar .brand {margin-left: 0;}</style> | |
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js"></script> | |
<script> |
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
macro python { | |
case print $params (,) ... => { | |
console.log(( $params (,) ... )) | |
} | |
// Function definition | |
case def $name:ident ( $params (,) ... ) : $a $b ... => { | |
function $name( $params (,) ... ) { python $a $b ... } | |
} | |
// Function call |
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
xrayquire = { | |
// ... | |
getTree: function (contextName) { | |
var context = requirejs.s.contexts[contextName || '_'], | |
xray = getX(context), | |
traced = xray.traced, | |
tree = {}; | |
sortTraceOrder(xray.traceOrder); |
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
{ | |
"id": "e0ff964f-6dd8-6c2a-1444-6afa58ff1500", | |
"name": "Local Auth", | |
"description": "", | |
"order": [ | |
"1e7c070f-2ad5-a777-8aea-da9e4a1b75bf", | |
"4423ded8-e38e-d852-9dd6-9177368e6d09" | |
], | |
"folders": [], | |
"timestamp": 1431125920517, |
NewerOlder