Skip to content

Instantly share code, notes, and snippets.

Jayson Harshbarger Hypercubed

Block or report user

Report or block Hypercubed

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
@developit
developit / *valoo.md
Last active Jan 22, 2019
🐻 Valoo: just the bare necessities of state management. 150b / 120b. https://npm.im/valoo
View *valoo.md

🐻 valoo

just the bare necessities of state management.

Usage

Hotlink it from https://unpkg.com/valoo.

See Interactive Codepen Demo.

@matthewp
matthewp / programming-language.md
Last active Mar 28, 2016
programming-language.md
View programming-language.md

Motivation

Writing JavaScript libraries that are stable is hard, too hard. The extreme level of modularity we practice has only made things worse, as it's become very easy to depend on quirks/bugs that exist in other libraries.

The approach that is most often taken to increase stability in a programming language is to introduce Types. That is, trade expressiveness for better static reasoning. The point being, the compiler should be able to find bugs in your program.

I'm interested in another approach; make it easier for the developer to find bugs themselves. To that end, the motivation for this language is to be easy to test. What if everything within a programs closure was available to be mocked.

exports.getName = function(person){
@bterlson
bterlson / mod.js
Last active Jan 26, 2017
Module export forms have subtle differences
View mod.js
// exporter1.js
let foo = 1;
export { foo as default }; // exports the foo binding
foo = 2;
// exporter2.js
let foo = 1;
export default foo; // creates a new binding named *default* and initializes it to 1.
foo = 2; // assigns to the foo binding which is not exported
@bishboria
bishboria / springer-free-maths-books.md
Last active Jul 23, 2019
Springer made a bunch of books available for free, these were the direct links
View .gitignore
jspm_packages
View README.md
@zachlysobey
zachlysobey / ng-directive-inline-multi-line-template-string.es6.js
Last active Mar 3, 2016
Angular 1 Directive with ES6 Multi-line string template inline.
View ng-directive-inline-multi-line-template-string.es6.js
(function() {
'use strict';
angular
.module('myModule')
.directive('myDirective', myDirective);
const template = `
<div class="my-directive-template">
<h1>Using multi-line Strings for templates</h1>
@Hypercubed
Hypercubed / directive.js
Last active Jun 3, 2016
Use systemjs/plugin-text to import html directly to $routeProvider or $templateCache, works great with jspm bundle.
View directive.js
import somethingHTML from './something.html!text';
angular.module('myApp',[])
.directive('myDirective', function() {
return {
template: somethingHTML
}
});
View angular2.jspm.md

Angular2 + JSPM cheat sheet

First time setup

  • install jspm beta: npm install -g jspm@beta
  • set up your project: jspm init
  • install dependencies: jspm install angular2 reflect-metadata zone.js es6-shim

This will create a jspm_packages folder, and a config.js file.

Open the config.js file - this file manages options for the System.js loader - tweak it as appropriate

@pilwon
pilwon / code.js
Last active Oct 13, 2015
react-native DependencyResolver perf test (script & full result) https://github.com/facebook/react-native/issues/361#issuecomment-87829808
View code.js
var path = require('path');
var async = require('async');
var mathjs = require('mathjs');
var ReactPackager = require('react-native/packager/react-packager');
var blacklist = require('react-native/packager/blacklist');
var reactNativePackage = require('react-native/package');
var NUM_TESTS = 100;
function test() {
You can’t perform that action at this time.