Skip to content

Instantly share code, notes, and snippets.

View WizardSource's full-sized avatar
:octocat:
ᦔ꠸ᦓᥴꪮꪜꫀ᥅

Cliff WizardSource

:octocat:
ᦔ꠸ᦓᥴꪮꪜꫀ᥅
View GitHub Profile
|- (p -> r) | (q -> r) -> (p & q -> r)
---
(p -> r) | (q -> r) |- p & q -> r
---
(p -> r) | (q -> r), p & q |- r
---
(p -> r) | (q -> r), p, q |- r
---1-1
p -> r, p, q |- r
---
@victor-homyakov
victor-homyakov / links - writing fast code for react and typescript.md
Last active July 11, 2023 00:47
Ссылки для презентации "Код на React и TypeScript, который работает быстро"
@khalby786
khalby786 / server.js
Created August 26, 2020 11:27
GitHub oAuth Login with Express & without Passport.js
const express = require("express");
const app = express();
var session = require('express-session');
const fetch = require('node-fetch');
const clientID = process.env.CLIENT_ID;
const clientSecret = process.env.CLIENT_SECRET;
async function getAccessToken(code, client_id, client_secret) {
const request = await fetch("https://github.com/login/oauth/access_token", {
@freddi301
freddi301 / fiber.ts
Created August 20, 2019 22:27
Fiber (react fibers outside react) immutable version
type FiberFunction<Args extends any[], Return> = (
cell: CellFunction
) => (...args: Args) => Return;
type FiberInstance<Args extends any[], Return> = (
...args: Args
) => [Return, FiberInstance<Args, Return>];
type FiberFactory = <Args extends any[], Return>(
fiber: FiberFunction<Args, Return>,
@lpalmes
lpalmes / react.md
Last active May 7, 2021 17:59
React and Reconcilers in Reason

React

This is the base of all projects and it will include the foundation for all potential react-based projects in Reason.

This base package should include a ReasonReact api to promote collaboration and familiarity with people using a ReasonReact, and for the modern world of React this should also include a Hooks api that currently revery uses.

React module

All blocks in Jsx are of type React.reactElement. This reactElement should represent:

@anish000kumar
anish000kumar / listMidNode.js
Created November 9, 2018 17:47
Get middle node of linked list
function getListMiddle(head){
let slow = head;
let fast = head;
let moveBoth = false;
// to get second element, in case of two mid-nodes, use 'fast' instead of 'fast.next'
while(fast.next){
if(moveBoth){
slow = slow.next;
fast = fast.next;

3 Gripes With React

I started using React 3.5 years ago, and I still love it. It was such a well-designed solution that not much has changed since then, only superficial stuff like naming. What I learned then is still wholly applicable today because it's such a good idea (although now you can choose from many other libraries). On top of that, we now benefit from an entirely new architecture (fiber) without changing much.

@alexellis
alexellis / HashTableInJavaScript.js
Created March 8, 2016 20:15
HashTableInJavaScript
function AHashtable(size) {
this.table = this.init_table(size);
}
AHashtable.prototype.set = function(key, value) {
var self = this;
var index = self.jenkins_hash(key, self.table.length);
self.table[index] = value;
};
'use strict';
function BinarySearchTree() {
this.root = null;
}
BinarySearchTree.prototype.insertNode = function (val) {
var node = {
data : val,
@alexhawkins
alexhawkins / HashTable.js
Last active August 7, 2021 23:33
Correct Implementation of a Hash Table in JavaScript
var HashTable = function() {
this._storage = [];
this._count = 0;
this._limit = 8;
}
HashTable.prototype.insert = function(key, value) {
//create an index for our storage location by passing it through our hashing function
var index = this.hashFunc(key, this._limit);