- Operators, operands, operator precedence (unary, binary, ternary)
- Dynamic Type system: types and conversion
- Value type vs. Reference type
- Expression vs. Statement
- Scope
- Hoisting
- Overloading
- Prototypal inheritance vs. Classical inheritance
- Instancing
This file contains hidden or 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
// | |
// Mixin to provide short-hand positioning syntax | |
// https://gist.github.com/branneman/9248961 | |
// | |
// Usage: | |
// @include position(0 false 0 20rem); | |
// @include position(absolute, 0 false 0 20rem); | |
// | |
@mixin position ($position: relative, $coordinates: 0 0 0 0) { |
This file contains hidden or 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
# Aliasses | |
Set-Alias l ls | |
Set-Alias e explorer | |
# Force coloring of git and npm commands | |
$env:TERM = 'cygwin' # windows-ansi | cygwin | |
$env:LESS = 'FRSX' | |
# | |
# Custom prompt |
This file contains hidden or 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
'use strict'; | |
var glob = require('glob'); | |
module.exports = function Gruntfile(grunt) { | |
var config = grunt.file.readJSON('./app/config'); | |
grunt.loadNpmTasks('grunt-htmllint-http'); |
This file contains hidden or 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
/** | |
* @module Registry pattern implementation | |
*/ | |
define(function() { | |
'use strict'; | |
/** | |
* Constructor | |
*/ |
This file contains hidden or 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 net = require('net'); | |
// | |
// Client | |
// | |
function openSocket() { | |
var socket = net.connect(3e3); | |
socket.setKeepAlive(true); | |
socket.on('connect', onConnect.bind({}, socket)); |
This file contains hidden or 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
/** | |
* @module MyModule | |
*/ | |
define(['dep1'], function(dep1) { | |
"use strict"; | |
/** | |
* @param {HTMLElement} element | |
* @param {Object} options |
This file contains hidden or 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
/** | |
* @param {Event} evt | |
* @return {Object} | |
*/ | |
function getMousePosition(evt) { | |
var pageX = evt.pageX; | |
var pageY = evt.pageY; | |
if (pageX === undefined) { | |
pageX = evt.clientX + document.body.scrollLeft + document.documentElement.scrollLeft; |
This file contains hidden or 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 fl = require('fantasy-land') | |
const inspect = require('util').inspect.custom | |
// Fantasy Land | |
// of :: Applicative f => a -> f a | |
// map :: Functor f => f a ~> (a -> b) -> f b | |
// ap :: Apply f => f a ~> f (a -> b) -> f b | |
// chain :: Chain m => m a ~> (a -> m b) -> m b | |
/** |
This file contains hidden or 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
/** | |
* Pair | |
* @todo Implement algebraic structures: Setoid, Functor | |
*/ | |
var Pair = function(fst, snd) { | |
if (this instanceof Pair) { | |
if (Array.isArray(fst) && fst.length === 2 && typeof snd == 'undefined') { | |
this[0] = fst[0]; | |
this[1] = fst[1]; | |
} else { |