Skip to content

Instantly share code, notes, and snippets.

View RealDyllon's full-sized avatar
🎯
Focusing

Dyllon Gunawardhana RealDyllon

🎯
Focusing
View GitHub Profile

CZ1115 Code Snippets and Samples

Made with ♥️ by Dyllon

@sindresorhus
sindresorhus / esm-package.md
Last active April 24, 2024 02:07
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.
@RealDyllon
RealDyllon / pandora-enhancer-chrome.js
Last active December 21, 2021 23:16
Enhance Pandora via Tampermonkey / Greasemonkey
// ==UserScript==
// @name Pandora Enhancer
// @namespace https://www.pandora.com/
// @version 1.0
// @description hides perma-sidebar for ads
// @author www.github.com/RealDyllon
// @match https://www.pandora.com/*
// @icon https://www.google.com/s2/favicons?domain=pandora.com
// @require https://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js
// @require https://gist.github.com/raw/2625891/waitForKeyElements.js
@RealDyllon
RealDyllon / web.config
Last active October 14, 2020 10:15 — forked from davidebbo/web.config
Default web.config used for node.js apps on Azure Web Apps
<?xml version="1.0" encoding="utf-8"?>
<!--
AZURE APP SERVICE - WEB CONFIG FOR EXPRESS APP HOSTED ON WINDOWS WEB APP
-->
<!--
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
-->
@jacobsoo
jacobsoo / pyDeliveryTimeslots.py
Created April 18, 2020 06:52
This is just a simple script for Covid-19 to check if there are any delivery timeslots based on your postal code.
import os, sys, re
import requests
from requests.packages.urllib3.exceptions import InsecureRequestWarning
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
def _log(szString):
print(szString)
def main(PostalCode):
'''
@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
# Fastfile
#
# Author: Ronaldo Lima <ronal2do@gmail.com>
#
# -----------------------------------------------------------
#
# Version bumping, the default type is `patch`
# Run:
# `fastlane ios bump`
# `fastlane ios beta [type:major|minor|patch]`
@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)

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

@rambabusaravanan
rambabusaravanan / detect-js-framework.js
Last active April 8, 2024 12:39
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');