Skip to content

Instantly share code, notes, and snippets.

View danielstern's full-sized avatar
💭
🙈 🙉 🙊

Daniel Stern danielstern

💭
🙈 🙉 🙊
View GitHub Profile
import {createStore, applyMiddleware} from 'redux'
import createSagaMiddleware from 'redux-saga';
import decoristReducers from '../reducers/decorist_reducer'
import sagas from '../sagas/sagas';
const sagaMiddleware = createSagaMiddleware();
/**
* Add all the state in local storage
@seripap
seripap / months.js
Created October 8, 2015 21:32 — forked from bgadrian/months.js
JavaScript JS month names arrays
var month= ["January","February","March","April","May","June","July",
"August","September","October","November","December"];
var month = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul","Aug", "Sep", "Oct", "Nov", "Dec"];
//used with date.getMonth()
@wmertens
wmertens / full stack redux.md
Last active February 8, 2022 22:46
making an awesome server with the redux model, Work In Progress

Thought experiment: Redux-like stateless server

Description

We describe a model for client-server processing where the Redux model is used to minimize stateful code. This should allow live-reloading server code, and make it possible to share code (e.g. optimistic updating) between client and server.

Dramatis Personae

  • Assume a server consisting of multiple worker processes that do not share memory and may be running on multiple hosts.
    • Workers have middleware, root reducers and an app state object
  • Workers can be dynamically added and removed
@AlexNisnevich
AlexNisnevich / shuffle.elm
Last active February 13, 2017 15:07
Shuffling a list in Elm
import List
import Random
without : Int -> [a] -> [a]
without i arr =
let before = take i arr
after = drop (i+1) arr
in
before ++ after
@beoliver
beoliver / booleans.js
Last active December 28, 2022 20:18
javascript boolean matches (and / nand / or / nor / xor / iff / all / any / none )
// a better name would be - if predicate is True then success, else not success.
// using basic logic we can now create logic functions that compute only as much as required
// anyBool :: (a -> Bool) -> Bool -> [a] -> Bool
function anyBool(pred,success,xs) {
for (var i = 0; i < xs.length; i++) {
if (pred(xs[i]) === success) {
return success }}
return !success }
@rxaviers
rxaviers / gist:7360908
Last active April 19, 2024 18:56
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@wteuber
wteuber / fmod.js
Last active February 6, 2024 14:47
fmod for Javascript, will work with any ECMA-262 implementation.If you need a precision higher than 8, please use another implementaion of fmod.
/*
fmod for Javascript, will work with any ECMA-262 implementation.
If you need a precision higher than 8, please use another implementation of fmod.
1.05 % 0.05
=> 0.04999999999999999
Math.fmod(1.05, 0.05)
=> 0
@necolas
necolas / README.md
Last active March 28, 2024 20:34
Experimenting with component-based HTML/CSS naming and patterns

NOTE I now use the conventions detailed in the SUIT framework

Template Components

Used to provide structural templates.

Pattern

t-template-name