Skip to content

Instantly share code, notes, and snippets.

View mgcrea's full-sized avatar
🚀
Norminal

Olivier Louvignes mgcrea

🚀
Norminal
  • Freelance
  • Paris, France
View GitHub Profile

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

@aweary
aweary / App.js
Last active August 29, 2021 14:06
import React from "react";
import useMutableReducer from "./useMutableReducer";
const reducer = (draft, action, state) => {
switch (action) {
case "increment":
draft.count++;
break;
case "decrement":
draft.count--;
@albi90
albi90 / building node-webkit on armv7 hardfp
Last active June 19, 2020 17:17
howto build node-webkit on armv7 hardfp
sudo apt-get install libatk1.0-0 libc6 libasound2 libcairo2 libcups2 libexpat1 libfontconfig1 libfreetype6 libglib2.0-0 libgnome-keyring0 libgtk2.0-0 libpam0g libpango1.0-0 libpci3 libpcre3 libpixman-1-0 libpng12-0 libspeechd2 libstdc++6 libsqlite3-0 libx11-6 libxau6 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxdmcp6 libxext6 libxfixes3 libxi6 libxinerama1 libxrandr2 libxrender1 libxtst6 zlib1g apache2.2-bin bison curl elfutils fakeroot flex g++ gperf libapache2-mod-php5 libasound2-dev libbz2-dev libcairo2-dev libcups2-dev libcurl4-gnutls-dev libelf-dev libgconf2-dev libgl1-mesa-dev libglib2.0-dev libglu1-mesa-dev libgnome-keyring-dev libgtk2.0-dev libkrb5-dev libnspr4-dev libnss3-dev libpam0g-dev libpci-dev libpulse-dev libsctp-dev libspeechd-dev libsqlite3-dev libssl-dev libudev-dev libwww-perl libxslt1-dev libxss-dev libxt-dev libxtst-dev mesa-common-dev metacity patch perl php5-cgi pkg-config python python-cherrypy3 python-dev python-psutil rpm ruby subversion ttf-dejavu-core ttf-indic-fonts ttf-koc
@adammw
adammw / buildnode.sh
Last active March 5, 2016 16:44
Node.js for Raspberry Pi Packaging Script
#!/bin/sh
## Node.js for Raspberry Pi Packaging Script
## =========================================
## Execute this script from within node.js git repo
## Use like this:
## ~/node/$ VERSION=v0.10.0 ./buildnode.sh
if [ -z $VERSION ]; then
echo "set the VERSION first"
exit 1
@deckar01
deckar01 / gist:beb96fc0afc0715f01bb
Created July 16, 2015 20:43
Two Buckets One Tap
function Bucket(capacity, level){
this.capacity = capacity;
this.level = level || 0;
}
Bucket.prototype.fill = function(){
this.level = this.capacity;
}
Bucket.prototype.discard = function(){
this.level = 0;
}