Skip to content

Instantly share code, notes, and snippets.

View kalisjoshua's full-sized avatar

Joshua T Kalis kalisjoshua

View GitHub Profile
@codinronan
codinronan / useAuth.js
Created November 29, 2020 03:26
React hook: useAuth
import React, { useCallback, useState, useEffect, useContext, createContext } from 'react'
const authContext = createContext()
// Hook for child components to get the auth object and re-render when it changes.
export default () => {
return useContext(authContext)
}
// Provider component that wraps components and makes useAuth() available
@kalisjoshua
kalisjoshua / README.md
Last active July 1, 2016 15:45
Exploration of Curry-ing function in JavaScript

Curry-ing Functions In JavaScript

I don't know why, but this morning I felt like exploring function curry-ing and writing a little bit about it. First I watched a video on curry-ing from the JS Weekly newletter. Then I wanted to write my own implementation. After that I thought I would share what I did with my team at work and then this.

Brain-dump over.

The only reason I created two different implementations is becuase semantically I think that a function is only curried once; as I understand it - to curry - is a process by which you convert a single function which takes multiple arguments into a series of multiple functions each taking exactly one argument.

So, while the implementations work identically from the point of view of the user the differ in their implementation; basically only semantically.

@remy
remy / project-structure.md
Last active February 18, 2019 03:35
My (general) new node project directory structure

Project structure

Example project directory, the root folders are pretty consistent, the sub directories (on lib, etc) are just examples of what might be in there.

.
├── lib
│   ├── db
│   ├── handlers
│   └── routes
@mathias-brandewinder
mathias-brandewinder / gist:5558573
Last active October 31, 2023 05:05
Stub for F# Machine Learning Dojo
// This F# dojo is directly inspired by the
// Digit Recognizer competition from Kaggle.com:
// http://www.kaggle.com/c/digit-recognizer
// The datasets below are simply shorter versions of
// the training dataset from Kaggle.
// The goal of the dojo will be to
// create a classifier that uses training data
// to recognize hand-written digits, and
// evaluate the quality of our classifier