Skip to content

Instantly share code, notes, and snippets.

View Youhan's full-sized avatar
😊

Alireza Jahandideh Youhan

😊
View GitHub Profile
@mmocny
mmocny / inp-devtools-watch.js
Created April 14, 2023 14:12
Add these snippets to DevTools (console) Watch expressions
// max-INP:
(()=>{let o=globalThis;return void 0===o.winp&&(o.winp=0,new PerformanceObserver(n=>{for(let e of n.getEntries()){if(!e.interactionId)continue;o.winp=Math.max(e.duration,o.winp);let r=o=>o<=200?"color: green":o<=500?"color: yellow":"color: red";console.log(`%c[Interaction: ${e.name.padEnd(12)}] %cDuration: %c${e.duration}`,"color: grey; font-family: Consolas,monospace","",r(e.duration))}}).observe({type:"event",durationThreshold:0,buffered:!0})),o.winp})();
// interactionCount
performance.interactionCount;
const childProcess = require("child_process");
// https://vercel.com/support/articles/how-do-i-use-the-ignored-build-step-field-on-vercel
const ABORT_BUILD_CODE = 0;
const CONTINUE_BUILD_CODE = 1;
const continueBuild = () => process.exit(CONTINUE_BUILD_CODE);
const abortBuild = () => process.exit(ABORT_BUILD_CODE);
const app = process.argv[2] || path.basename(path.resolve());
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@oanhnn
oanhnn / using-multiple-github-accounts-with-ssh-keys.md
Last active May 19, 2024 07:15
Using multiple github accounts with ssh keys

Problem

I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).

Solution

Use ssh keys and define host aliases in ssh config file (each alias for an account).

How to?

  1. Generate ssh key pairs for accounts and add them to GitHub accounts.
@msurguy
msurguy / List.md
Last active April 30, 2024 15:14
List of open source projects made with Laravel

Other people's projects:

My projects (tutorials are on my blog at http://maxoffsky.com):

@icodejs
icodejs / ajaxListener.js
Created July 26, 2012 16:47
JS: Listen to ajax calls from Javascript
var open = window.XMLHttpRequest.prototype.open,
send = window.XMLHttpRequest.prototype.send,
onReadyStateChange;
function openReplacement(method, url, async, user, password) {
var syncMode = async !== false ? 'async' : 'sync';
console.warn(
'Preparing ' +
syncMode +
' HTTP request : ' +
@subfuzion
subfuzion / gist:1128192
Created August 5, 2011 18:37
Git Tips: Reset, Clean - Remove untracked files and directories from the working tree when switching branches or checking out different commits.
git reset --hard
git clean -f -d
Description:
============
Git Tips: Remove untracked files and directories from the working
tree when switching branches or checking out different commits.
Explanation: