Skip to content

Instantly share code, notes, and snippets.

View dan-mckay's full-sized avatar

Daniel McKay dan-mckay

View GitHub Profile
@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)
@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
@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
@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)
@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 (
@dan-mckay
dan-mckay / gist:edb8b88585c2c89ca610
Last active July 17, 2020 10:37 — forked from mikenairn/gist:c8fdedc420d24d5f891f
ENG _ REBASE_YOUR_COMMITS!!!

Update all remotes

git fetch --all

Change to my branch

git checkout my-branch
// Author : Prathap Reddy SV
var LStorage = (function () {
function LStorage() {
this.localStorage = JSON.parse(JSON.stringify(localStorage));
// or new Function("return JSON.parse('" + JSON.stringify(localStorage) + "')")();
}
LStorage.prototype.setItem = function (key, val) {
if(this.localStorage[key] == val) return;
this.localStorage[key] = val;
@DanHerbert
DanHerbert / fix-homebrew-npm.md
Last active February 12, 2024 17:18
Instructions on how to fix npm if you've installed Node through Homebrew on Mac OS X or Linuxbrew

OBSOLETE

This entire guide is based on an old version of Homebrew/Node and no longer applies. It was only ever intended to fix a specific error message which has since been fixed. I've kept it here for historical purposes, but it should no longer be used. Homebrew maintainers have fixed things and the options mentioned don't exist and won't work.

I still believe it is better to manually install npm separately since having a generic package manager maintain another package manager is a bad idea, but the instructions below don't explain how to do that.

Fixing npm On Mac OS X for Homebrew Users

Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.

@branneman
branneman / better-nodejs-require-paths.md
Last active April 8, 2024 00:22
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

const Article = require('../../../../app/models/article');

Those suck for maintenance and they're ugly.

Possible solutions

@brianloveswords
brianloveswords / eff-you-region-lock.md
Last active December 22, 2015 15:08
Defeating region lock

Prerequisites

  • Somewhat modern version of OpenSSH
  • Server you have SSH access to in the region you want to stream from.

Bummed about region lock? Start up your terminal and do this:

$ ssh -N -D 9999 yourserver.com