Skip to content

Instantly share code, notes, and snippets.

View tomzaku's full-sized avatar
🤤
Make some noise

Zaku tomzaku

🤤
Make some noise
  • Singapore
View GitHub Profile
@tomzaku
tomzaku / index.js
Created December 13, 2021 17:14
PAM AIR get data
var jwt = require("jsonwebtoken");
var fetch = require("node-fetch");
const config = {
secret: "d4f02c6e-f040-4413-84e0-136f0b557d4c",
clientId: "3cf9d988-d2d9-45a1-8c9c-3552849909c7",
};
var jwt = require("jsonwebtoken");
import React from 'react';
import Modal from '../Modal';
import { connect } from 'react-redux';
import { noop } from 'helpers';
let openModalTimer;
let closeModalTimer;
export const ExtendTimerContext = React.createContext({
startExtendTimer: noop,
@tomzaku
tomzaku / zero-width-space.txt
Last active September 25, 2019 09:36
Zero width space
‌‌
@tomzaku
tomzaku / range_array_perf.js
Last active June 24, 2019 04:28
Performance when creating a range of array (0...N)
const LENGTH_MAX = 10000000
// 1. Fastest way
const date1 = new Date();
const originalData1 = Array.from({length: LENGTH_MAX}).map((_, index) => ({
id:index,
name: `demo_${index}`,
}))
const date2 = new Date();
@tomzaku
tomzaku / programming-paradigms.md
Last active January 4, 2019 04:40
Programming paradigms
@tomzaku
tomzaku / dependency-react.md
Last active November 30, 2018 05:26
DEPENDENCY LISTING FOR REACT, Redux

DEPENDENCY LISTING

Requirements

Everytime an dependency is added, the reason for adding it should be written down here. E.g. purpose, etc.

1. Component

@blueprintjs

The core framework UI including basic components
function hackIt() {
speed = 45; // in wpm (50 => 97 wpm)
inp = document.getElementsByTagName('input');
x = document.getElementsByTagName('span');
text = "";
init = 0;
end = 0;
for (var i = 0; i < x.length; i++) {
if (x[i].className === "lblUsername")
@tomzaku
tomzaku / redux.md
Last active November 24, 2021 09:04
Redux

https://github.com/markerikson/react-redux-links

  • server rendering
  1. About State Management

a. Mobx (imperative programing, mutable data) b. Redux (declarative programming, immutable data, functional programming): preditable data

1.b.1: Immutable vs Mutable