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
@acutmore
acutmore / README.md
Last active Dec 6, 2019
Emulating a 4-Bit Virtual Machine in (TypeScript\JavaScript) (just Types no Script)
View README.md

A compile-time 4-Bit Virtual Machine implemented in TypeScript's type system. Capable of running a sample 'FizzBuzz' program.

Syntax emits zero JavaScript.

type RESULT = VM<
  [
    ["push", N_1],         // 1
    ["push", False],       // 2
    ["peek", _],           // 3
@developit
developit / *valoo.md
Last active Dec 12, 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 Dec 13, 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

You can’t perform that action at this time.