Skip to content

Instantly share code, notes, and snippets.

View Chadtech's full-sized avatar

Chadtech Chadtech

  • SuperFocus.ai
  • Pennsylvania
View GitHub Profile
# In Reducer
state =
currentFilters: [
{
by: 'active'
filter: (equipmentItem) ->
equipmentItem.active
}
{
by: 'category'
// In Reducer
state =
currentFilters: [
{
by: 'active',
filter: function(equipmentItem){
return equipmentItem.active
}
},
{
update : Action -> Model -> Model
update action model =
case action of
Reset -> init 0 0
Top act ->
{ model |
topCounter = Counter.update act model.topCounter
}
# Libraries
_ = require 'lodash'
# Html is
# <body>
# <div id = "root" yeee="Dope">
# </div>
# </body>
stringifyHTML = (el) ->
How long it takes to do each operation a million times in miliseconds
Create a Div
920.55
Get by ID
104.3
Set Attribute
307.6
@Chadtech
Chadtech / what.txt
Last active February 2, 2016 01:31
> String.prototype.toLowerCase = function(){ console.log('DANK!!!!!') }
[Function]
> DANK!!!!!
aDANK!!!!!
lDANK!!!!!
dDANK!!!!!
aDANK!!!!!
jDANK!!!!!
aDANK!!!!!
sDANK!!!!!
# module.coffee
module.exports.four = 4
module.exports = -> console.log 'DOPE'
# app.coffee
ye = require './module'
ye()
# 'DOPE'
drawLander : Ship -> Element
drawLander reasey =
let
lander = "lander.png"
mainThruster =
if reasey.thrusters.main == 1 then
"blast_main.png"
else
"blast_main_none.png"
in
drawLander : Ship -> Element
drawLander reasey =
let
lander =
toForm <| image 138 138 "lander.png"
mainThruster =
if reasey.thrusters.main == 1 then
[
move (0, -32)
// A
(function() {
var app, main;
main = document.getElementById('main');
app = Elm.embed(Elm.main, main);
app.ports.ye.subscribe(function(what) {