Skip to content

Instantly share code, notes, and snippets.

@sloosch
sloosch / ng-annotate-loader.js
Created January 31, 2015 18:41
ng annotate webpack loader with source map support
var ngAnnotate = require('ng-annotate');
var utils = require('loader-utils');
var SourceMapConsumer = require('source-map').SourceMapConsumer;
var SourceMapGenerator = require('source-map').SourceMapGenerator;
module.exports = function(content, sm) {
var filename = utils.getCurrentRequest(this);
var res = ngAnnotate(content, {
add : true,
@sloosch
sloosch / Main.js
Last active February 28, 2016 21:10
Purescript Gravity
//module Main
exports.requestAnimationFrame = function (eff) {
return function requestFrame() {
return window.requestAnimationFrame(eff());
};
};
@sloosch
sloosch / FindMe.purs
Created April 1, 2016 19:10
Maybe Find Greatest and Smallest File
module Main where
import Prelude
import Data.Maybe
import Control.Monad.Eff.Console (print)
import Data.Foldable (class Foldable, foldl)
import Control.Alt ((<|>))
type FileSize = Int
data Path = Path FileSize | Missing
@sloosch
sloosch / ClickCounter.purs
Created May 6, 2016 10:35
Adapt State and Actions
module ClickCounter where
import Prelude
import Component as C
import Pux.Html as H
import Pux.Html.Events as E
import Data.Generic (class Generic)
type State = Int
@sloosch
sloosch / NestedRoutes.purs
Created July 30, 2016 15:54
nested routes
module Main where
import HeroPrelude
import Component as C
import Counter as Counter
import Data.String as String
import Pux as Pux
import Pux.Html as H
import Pux.Router as PuxRouter
import TypeHere as TypeHere