Skip to content

Instantly share code, notes, and snippets.

View nlydv's full-sized avatar
👁️

Neel Yadav nlydv

👁️
View GitHub Profile
@garretmh
garretmh / lib.es5.d.ts
Last active September 4, 2023 17:32
Proposed JSON type definition update
/** A parsed JSON value. */
export type json =
| string
| number
| boolean
| null
| json[]
| { [key: string]: json };
/** A JSON stringify-able value. */
@Jaid
Jaid / migratingRules.md
Last active February 21, 2024 10:48
ESLint rules for migrating projects from CommonJS to ESM

ESLint rules

The ESM standard is considered stable in NodeJS and well supported by a lot of modern JavaScript tools.

ESLint does a good job validating and fixing ESM code (as long as you don't use top-level await, coming in ESLint v8). Make sure to enable the latest ECMA features in the ESLint config.

  • .eslint.json
{
@mhucka
mhucka / gist:59e785a315d813d14cd0258b89a2fcac
Last active February 2, 2024 22:28
Stop the Adobe Creative Cloud app from auto-launching on login on macOS
#!/bin/bash
# =============================================================================
# @file GitHub gist
# @brief stop Adobe Creative Cloud app from auto-launching on login on macOS
# @author Michael Hucka <mhucka@caltech.edu>
# @created 2021-08-12
# @website https://gist.github.com/mhucka/59e785a315d813d14cd0258b89a2fcac
#
# I find Adobe Creative Cloud absolutely infuriating. It installs auto
# launchers that are not in the user's login app list, and the services are
@jivanpal
jivanpal / kill-adobe-daemons.sh
Last active August 6, 2023 17:23
Stop Adobe Creative Cloud daemons (background processes) in their tracks
#!/bin/bash
if [ "$1" = "-s" ] || [ "$1" = "--show" ]; then
show=true
else
show=false
fi
if $show || [ "$1" = "-v" ] || [ "$1" = "--verbose" ]; then
verbose=true
@apfelchips
apfelchips / defaults.duti
Last active December 23, 2023 03:53
set file-associations on macOS: ~ 🥖.config 🥖duti 🥖defaults.duti
# duti settings file
# src: https://gist.github.com/apfelchips/0073cb3e8d186115f590d318998c1025
# mkdir -p "${XDG_CONFIG_HOME:-$HOME/.config}/duti/" && curl -L "https://git.io/JRtzH" -o "${XDG_CONFIG_HOME:-$HOME/.config}/duti/default.duti"
# duti-apply wrapper: alias duti-apply='duti -v "${XDG_CONFIG_HOME:-$HOME/.config}/duti"'
## duti documentation http://duti.org/documentation.html
## see also: https://github.com/Lord-Kamina/SwiftDefaultApps#readme
# List of MIME Types:
@bobrosoft
bobrosoft / utils.js
Last active September 9, 2021 20:21
Node.js: writing shell scripts using modern JavaScript instead of Bash — https://medium.com/@vladimirtolstikov/774e0859f965
/**
* Executes shell command as it would happen in BASH script
* @param {string} command
* @param {Object} [options] Object with options. Set `capture` to TRUE, to capture and return stdout.
* Set `echo` to TRUE, to echo command passed.
* @returns {Promise<{code: number, data: string | undefined, error: Object}>}
*/
module.exports.exec = function (command, {capture = false, echo = false} = {}) {
command = command.replace(/\\?\n/g, ''); // need to merge multi-line commands into one string
@fnky
fnky / ANSI.md
Last active May 8, 2024 01:48
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@jesperorb
jesperorb / php_form_submit.md
Last active April 30, 2024 22:27
PHP form submitting with fetch + async/await

PHP Form submitting

If we have the following structure in our application:

  • 📁 application_folder_name
    • 📄 index.php
    • 📄 handle_form.php
    • 📄 main.js

And we fill our index.php with the following content just to get a basic website with a form working. You should be able to run this through a php-server of your choice.

@TimJDFletcher
TimJDFletcher / GNUPG_agent_forwarding.md
Last active April 29, 2024 12:48 — forked from surhudm/GNUPG_agent_forwarding.md
GnuPG agent forwarding

Forward GnuPG agent from macOS to Linux

On the remote machine

Run gpg once as your to create the directory structure

gpg --list-keys

For headless systemd based hosts

@0xjac
0xjac / private_fork.md
Last active May 8, 2024 00:17
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare git@github.com:usi-systems/easytrace.git