Skip to content

Instantly share code, notes, and snippets.

View dan-mckay's full-sized avatar

Daniel McKay dan-mckay

View GitHub Profile
@gaearon
gaearon / connect.js
Last active April 11, 2024 06:46
connect.js explained
// connect() is a function that injects Redux-related props into your component.
// You can inject data and callbacks that change that data by dispatching actions.
function connect(mapStateToProps, mapDispatchToProps) {
// It lets us inject component as the last step so people can use it as a decorator.
// Generally you don't need to worry about it.
return function (WrappedComponent) {
// It returns a component
return class extends React.Component {
render() {
return (
@mattdesl
mattdesl / modular-three.md
Last active December 9, 2021 03:20
quick/easy ThreeJS hacking with npm

This isn't bullet-proof but here's how I've doing things lately:

modular ThreeJS quickie

  • npm install three --save
  • Include this in your browserify/webpack root script, typically your index.js:
global.THREE = require('three')
  • Add the "THREE" global to your linter (e.g. semistandard/eslintrc)
@busypeoples
busypeoples / UnderstandingReducer.re
Last active November 11, 2018 15:22
Understanding Reducer in ReasonML
let se = ReasonReact.stringToElement;
type state = int;
type actions =
| Inc
| IncWithSideEffect
| SideEffect
| DoNothing
| SilentIncUpdate
@cezarneaga
cezarneaga / Workshop Handout.md
Last active November 23, 2017 19:22
a sum-up of recorded knowhow

Reason Workshop @ReactiveConf 2017

by: Sean Grove, Jared Forsyth, Daniel Woelfel
support team: Cristiano Calcagno, @reasonvienna - @ryyppy @svensauleau @cezarneaga and @nikgraf in spirit, @matystl, @MyNaartjie

Support and Questions: Join discord channel

Workshop Presentation

  • workshop flow and exercises
@namratachaudhary
namratachaudhary / daal-mash.md
Created November 6, 2020 19:02
Not-so-boring daal

DO NOT ADD OIL, BUTTER, GHEE OR ANY SPICES TILL THIS STEP OR YOU WILL NOT BE ABLE TO PRESERVE THIS IN THE FRIDGE

This is the mash we prepare with blend of lentils and peas, and this can be preserved in the fridge for upto 2 weeks. The quantity below makes enough 4/5 medium portion sizes (depending upon what your definition is, but for one 1 portion of daal is enough for 100gm of rice)

Ingredients -

  • 50 gm masoor daal (pink one)
  • 100 gm moong daal (yellow lentils)
  • 150 gm toor daal (yellow split pigeon peas - not oily ones)
  • 1/2 tsp tumeric
  • 2 chopped chillies (optional, but do not add more)