Skip to content

Instantly share code, notes, and snippets.

@pascalpp
pascalpp / backbone.when.js
Last active August 29, 2015 13:57
Backbone.When
define(function(require) {
'use strict';
/* MODULE DEPENDENCIES */
var Backbone = require('backbone'),
_ = require('underscore');
/*
Backbone.When
2014-02-20 by pascal
@stubbornella
stubbornella / css-stats-ack.sh
Created October 1, 2012 22:07 — forked from pjkix/css-stats-ack.sh
shell script to generate some css file statistics
#!/bin/bash
## v1.0.6
## this script will gernerate css stats
### example output
# CSS STATS
# ----------
# Floats: 132
@ryndel
ryndel / handlebars.linkify.js
Created October 14, 2012 01:17
Handlebars.js: linkify helper #cc #handlebars
Handlebars.registerHelper('linkify', function (text) {
text = text.replace(/(https?:\/\/\S+)/gi, function (s) {
return '<a href="' + s + '">' + s + '</a>';
});
text = text.replace(/(^|)@(\w+)/gi, function (s) {
return '<a href="http://twitter.com/' + s + '">' + s + '</a>';
});
text = text.replace(/(^|)#(\w+)/gi, function (s) {
@jamiebuilds
jamiebuilds / gulpfile.js
Last active December 21, 2015 12:51
Example single-file gulp setup
import {src, dest, watch, parallel, series} from 'gulp';
import lintPlugin from 'gulp-lint-plugin';
import testPlugin from 'gulp-test-plugin';
import buildPlugin from 'gulp-build-plugin';
const SRC_DIRECTORY = './src';
const TEST_DIRECTORY = './test';
const DIST_DIRECTORY = './dist';
const lintDir = dir => src(dir)
@jamiebuilds
jamiebuilds / amicus-briefs-in-support-of-apple.md
Last active March 4, 2016 04:07
Amicus Briefs in Support of Apple

Amicus Briefs in Support of Apple

Companies

  • Airbnb [6]
  • Amazon.com [8]
  • Atlassian [6]
  • AT&T [19,20]
  • Automattic [6,7]
  • AVG Technologies [21]
@gerhardberger
gerhardberger / .hyperterm.js
Created July 15, 2016 19:48
tomorrow night eighties colors for hyperterm
module.exports = {
config: {
// default font size in pixels for all tabs
fontSize: 13,
// font family with optional fallbacks
fontFamily: '"Droid Sans Mono", Menlo, monospace',
// terminal cursor background color (hex)
cursorColor: '#cccccc',

Parser

  • /src/parser/spider_monkey_ast.ml: The type definitions for the AST. Tries to stay very close to ESTree
  • /src/parser/lexer_flow.mll: The ocamllex lexer logic
  • /src/parser/parser_flow.ml: The recursive descent JS parser

Inference

  • /src/typing/type_inference_js.ml: Contains the "entry point" for inference (Function called infer_ast).
  • /src/typing/statement.ml: Most of the inference logic (runs through the AST and generates the initial constraints)
@almost
almost / proposal.md
Last active September 12, 2019 09:07
Reactive 2016 Lightning Talk Proposal: Get Flow

This is a proposal for a lightning talk at the Reactive 2016 conference.

NOTE: If you like this, star ⭐ the Gist - the amount of stars decides whether it makes the cut! You could also Retweet if you want :)

Get Flow

Type checking JavaScript with Flow

JavaScript is a dynamic language, and there's nothing wrong with that. It allows quick iteration and lowers barriers. However, sometimes some compile-time type checking is just what you need to keep your code in line and give yourself the confidence to build bigger and faster. Flow gives the best of both worlds. You can have normal JavaScript but you can also add types where they're helpful, and it adds zero cost at runtime. In this talk I'll show Flow as it applies to a Redux & React codebase.

@murtaugh
murtaugh / 1. single-line.html
Last active April 21, 2021 16:23
Blockquote patterns for ALA
<figure class="quote">
<blockquote>It is the unofficial force—the Baker Street irregulars.</blockquote>
</figure>
@kkemple
kkemple / konami-marionette-behavior.js
Last active July 9, 2021 20:14
Konami code Marionette Behavior
'use strict';
var Marionette = require('backbone.marionette'),
Konami;
Konami = Marionette.Behavior.extend({
defaults: {
code : [38, 38, 40, 40, 37, 39, 37, 39, 66, 65]
},
events: {