Skip to content

Instantly share code, notes, and snippets.

View sjy's full-sized avatar
🎯
Focusing

Johnson sjy

🎯
Focusing
View GitHub Profile
@sjy
sjy / RequestQuene.js
Created January 23, 2019 12:25
quene with max parallel task limits
export default class RequestQuene {
constructor(limits = 10, duration = 200) {
this.duration = duration
this.limits = limits
this.q = []
this.intervalId = null
this.intervalDuration = duration
this.numOfRunning = 0
}
@nondanee
nondanee / helper.py
Last active May 4, 2023 09:14
script for vscode ffmpeg lib replacement
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
@author: Nzix
"""
import os, shutil, platform, subprocess
import re, zipfile, json
import ssl
@sjy
sjy / tslint.json
Created November 15, 2017 16:27
TSLint Config File Using Prettier Config + My Preference
{
"extends": ["tslint:latest", "tslint-config-prettier"],
"linterOptions": {
"exclude": ["**/*.js"]
},
"rules": {
"interface-over-type-literal": false,
"member-access": false,
"ordered-imports": false,
"no-implicit-dependencies": false,
@sjy
sjy / .eslintrc
Last active April 17, 2017 05:44
eslintrc template (react-native) , extends airbnb, [ref](https://www.npmjs.com/package/eslint-config-airbnb)
{
"parser": "babel-eslint",
"env": {
"es6": true,
"node": true,
"jest": true
},
"ecmaFeatures": {
"jsx": true,
"restParams": true,
@paulirish
paulirish / what-forces-layout.md
Last active April 28, 2025 06:24
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@gaearon
gaearon / reduce-store-time-travel.js
Last active January 30, 2024 05:08
Time travelling concept with reducey stores and state atoms inspired by https://gist.github.com/threepointone/43f16389fd96561a8b0b#comment-1447275
/**
* Stores are just seed + reduce function.
* Notice they are plain objects and don't own the state.
*/
const countUpStore = {
seed: {
counter: 0
},
reduce(state, action) {
@johnpolacek
johnpolacek / .gitconfig
Last active March 8, 2025 22:15
My current .gitconfig aliases
[alias]
recent = "!git for-each-ref --sort=-committerdate refs/heads/ --format='%(committerdate:short) %(refname:short)' | head -n 10"
co = checkout
cob = checkout -b
coo = !git fetch && git checkout
br = branch
brd = branch -d
brD = branch -D
merged = branch --merged
st = status
@jankorbel
jankorbel / dabblet.css
Created April 8, 2012 10:39
CSS animated loading dots
/*
CSS animated loading dots
*/
body
{
background: #5A5C64;
}
.loading_dots