Skip to content

Instantly share code, notes, and snippets.

const people = [
{ id: 12, name: 'Billy', dob: '1998-10-05' },
{ id: 123, name: 'Bart', dob: '1993-02-15' },
{ id: 45, name: 'Belinda', dob: '1996-01-31' },
{ id: 67, name: 'Bonnie', dob: '1998-04-09' },
{ id: 89, name: 'Brenda', dob: '1996-07-08' },
{ id: 34, name: 'Bobby', dob: '1994-09-12' },
{ id: 234, name: 'Blake', dob: '2000-01-01' },
];
//Sending Data to the Server using Fetch()
//using jsonplaceholder for the data
//GET - queryStrings
// http://jsonplaceholder.typicode.com/posts?userId=1&postId=65
// http://jsonplaceholder.typicode.com/todos?userId=2
//POST
// http://jsonplaceholder.typicode.com/posts
const root = 'http://jsonplaceholder.typicode.com/';
let uri = root + 'posts';
@joskid
joskid / storageHooks.js
Created May 31, 2020 10:12 — forked from Paratron/storageHooks.js
Enables you to use hooks for localStorage and sessionStorage that even redraw all components when their respective values change.
import React from "react";
let lsBus = {};
let ssBus = {};
/**
* Redraw all components that have a hook to localStorage with the given key.
* @param {string} key
* @param {*} newValue
*/
import React, { Component } from 'react';
import Item from './Item';
import './App.css';
class App extends Component {
constructor(){
super();
this.state = {
import React, { Component } from 'react';
export default class Item extends Component{
constructor(props){
super(props);
this.state = {
num: props.num,
isSaved: false
}
@joskid
joskid / form.js
Created May 13, 2020 15:38 — forked from jeanbauer/form.js
Text Input using react hooks with a custom hook: useFormInput
import { useState } from 'react'
const Form = () => {
const name = useFormInput('Name')
return (
<>
<input {...name} />
</>
)
const useFetch = endpoint => {
const defaultHeader = {
Accept: "application/json",
"Content-Type": "application/json"
};
const customFetch = (
url,
method = "GET",
body = false,
headers = defaultHeader
@joskid
joskid / custom_game_engines_small_study.md
Created April 24, 2020 13:11 — forked from raysan5/custom_game_engines_small_study.md
A small state-of-the-art study on custom engines

CUSTOM GAME ENGINES: A Small Study

a_plague_tale

A couple of weeks ago I played (and finished) A Plague Tale, a game by Asobo Studio. I was really captivated by the game, not only by the beautiful graphics but also by the story and the locations in the game. I decided to investigate a bit about the game tech and I was surprised to see it was developed with a custom engine by a relatively small studio. I know there are some companies using custom engines but it's very difficult to find a detailed market study with that kind of information curated and updated. So this article.

Nowadays lots of companies choose engines like Unreal or Unity for their games (or that's what lot of people think) becaus

@joskid
joskid / plink-plonk.js
Created February 15, 2020 22:13 — forked from tomhicks/plink-plonk.js
Listen to your web pages
@joskid
joskid / why.markdown
Created July 9, 2016 01:14 — forked from egonSchiele/why.markdown
Why read Grokking Algorithms?

If you have already taken a course in algorithms, why read Grokking Algorithms (manning.com/bhargava)?

If you were learning graph algorithms, which approach would you prefer:

  1. Imagine you have to take public transit from your home to your office. How do you figure out the fastest route? Use graph algorithms! OR

  2. We can choose between two standard ways to represent a graph G = (V, E): as a collection of adjacency lists or as an adjacency matrix. Either way applies to both directed and undirected graphs.

I prefer the first way: lead with lots of examples, and clear writing. The second way is an excerpt from "Introduction to Algorithms"...that's how they start their section on graph algorithms.