Skip to content

Instantly share code, notes, and snippets.

View RealDyllon's full-sized avatar
🎯
Focusing

Dyllon Gunawardhana RealDyllon

🎯
Focusing
View GitHub Profile
@rambabusaravanan
rambabusaravanan / detect-js-framework.js
Last active April 25, 2024 11:31
Detect JS Framework used in a Website
// Paste these lines into website's console (Win/Linux: Ctrl + Shift + I / Mac: Cmd + Alt + I)
if(!!window.React ||
!!document.querySelector('[data-reactroot], [data-reactid]') ||
Array.from(document.querySelectorAll('*')).some(e => e._reactRootContainer !== undefined || Object.keys(e).some(k => k.startsWith('__reactContainer')))
)
console.log('React.js');
if(!!document.querySelector('script[id=__NEXT_DATA__]'))
console.log('Next.js');
@jboner
jboner / latency.txt
Last active April 25, 2024 11:20
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@sindresorhus
sindresorhus / esm-package.md
Last active April 25, 2024 08:14
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@yoavniran
yoavniran / ultimate-ut-cheat-sheet.md
Last active April 13, 2024 16:19
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai, Sinon, and Jest
@mike-casas
mike-casas / install-nvm-zsh.txt
Last active March 14, 2024 20:40
install nvm on mac with zsh shell
After install zsh
- brew update
- brew install nvm
- mkdir ~/.nvm
after in your ~/.zshrc or in .bash_profile if your use bash shell:
export NVM_DIR=~/.nvm
source $(brew --prefix nvm)/nvm.sh

Mac Dev Setup

Personally curated and highly opinionated list of applications, software, tools and other stuff for macOS with instructions on how to install them.

I recommend spending some time exploring each app and carefully examine if they actually fit your needs. Downloading software you don't need unecessarily bloats your Mac with wasted space. If you already know what you need, use the index to quickly traverse this document.

If you want a more comprehensive list, check out:
awesome-mac
awesome-macOS

@Atinux
Atinux / async-foreach.js
Last active October 10, 2023 03:04
JavaScript: async/await with forEach()
const waitFor = (ms) => new Promise(r => setTimeout(r, ms))
const asyncForEach = async (array, callback) => {
for (let index = 0; index < array.length; index++) {
await callback(array[index], index, array)
}
}
const start = async () => {
await asyncForEach([1, 2, 3], async (num) => {
await waitFor(50)
@davidebbo
davidebbo / web.config
Created January 16, 2016 20:52
Default web.config used for node.js apps on Azure Web Apps
<?xml version="1.0" encoding="utf-8"?>
<!--
This configuration file is required if iisnode is used to run node processes behind
IIS or IIS Express. For more information, visit:
https://github.com/tjanczuk/iisnode/blob/master/src/samples/configuration/web.config
-->
<configuration>
<system.webServer>
@szaydel
szaydel / afp-krb5.conf
Last active July 8, 2022 15:41 — forked from oscarcck/afp.conf
AFP Configuration File Examples
; Copyright 2009-2015 RackTop Systems Inc. and/or its affiliates.
; http://www.racktopsystems.com
;
; The methods and techniques utilized herein are considered TRADE SECRETS
; and/or CONFIDENTIAL unless otherwise noted. REPRODUCTION or DISTRIBUTION
; is FORBIDDEN, in whole and/or in part, except by express written permission
; of RackTop Systems.
;
; @@DESCRIPTION@@ Configuration file for Netatalk -- Apple Filing Protocol.
; @@NAME@@ afp.conf
@tyhawkins
tyhawkins / zoom-mute-status.scpt
Last active May 27, 2022 20:51
Get Zoom Mute/Unmute Status
property btnTitle : "Mute audio"
if application "zoom.us" is running then
tell application "System Events"
tell application process "zoom.us"
if exists (menu item btnTitle of menu 1 of menu bar item "Meeting" of menu bar 1) then
set returnValue to "Unmuted"
else
set returnValue to "Muted"
end if