made with esnextbin
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
function useFPS() { | |
const [fps, setFPS] = useState(0); | |
useEffect(() => { | |
let then = performance.now(); | |
let frames = 0; | |
let req; | |
(function loop(now) { | |
req = window.requestAnimationFrame(loop); |
made with esnextbin
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
function quicksort([ x, ...xs ]) { | |
if (!arguments[0].length) return []; | |
return [ ...xs.filter( y => y <= x ), x, ...xs.filter( y => y > x ) ]; | |
} |
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 state = { | |
resolve : { | |
foo : ( $http ) => $http.get( '/foo' ) | |
}, | |
controller : Controller | |
} | |
class Controller { | |
constructor( foo ) { | |
this.foo = foo.data; |
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
OUTPUT = sprites/svg-defs-sprite | |
reverse = $(2) $(1) | |
id = $(shell basename $(1) | sed 's/^ic_//;s/_24px\.svg$$//;s/_/-/g' ) | |
extract = $$(cat $(1) | egrep -o $(2) | tr '\n' ' ' | sed "s/id=\"/id=\"$(call id,$(1))-/g") | |
src := $(wildcard */svg/production) | |
dest := $(patsubst %/svg/production,$(OUTPUT)/%.svg,$(src)) | |
svg_start := '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><defs>' |
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
{ | |
"tasks": { | |
"gulp": "gulp", | |
"dev": "gulp watch" | |
}, | |
"devDependencies": { | |
"gulp": "*" | |
} | |
} |
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
export default class FooController { | |
// @ngInject | |
constructor( $document ) { | |
console.log( $codument ); | |
} | |
} |
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
( function( requirejs ) { | |
'use strict'; | |
requirejs.config({ | |
// ... config goes here | |
}); | |
})( typeof exports === 'object' ? { | |
config : function ( cfg ) { | |
'use strict'; |
NewerOlder