Skip to content

Instantly share code, notes, and snippets.

View danshilm's full-sized avatar

Danshil Kokil Mungur danshilm

View GitHub Profile
@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
{
@FunDeckHermit
FunDeckHermit / Gitea: docker-compose.yml
Last active July 4, 2021 18:23
Navidrome header authentication
version: "3"
services:
server:
image: gitea/gitea:latest
environment:
- USER_UID=1000
- USER_GID=1000
restart: always
volumes:
@LukeChannings
LukeChannings / AndroidManifest.xml
Created May 1, 2021 21:48
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8" standalone="no"?><manifest xmlns:android="http://schemas.android.com/apk/res/android" android:compileSdkVersion="29" android:compileSdkVersionCodename="10" android:installLocation="auto" package="com.plexapp.android" platformBuildVersionCode="29" platformBuildVersionName="10">
<uses-permission android:name="com.android.vending.BILLING"/>
<uses-feature android:name="android.hardware.touchscreen" android:required="false"/>
<uses-feature android:name="android.hardware.screen.landscape" android:required="false"/>
<uses-feature android:name="android.hardware.location" android:required="false"/>
<uses-feature android:name="android.hardware.location.gps" android:required="false"/>
<uses-feature android:name="android.hardware.location.network" android:required="false"/>
<uses-feature android:name="android.hardware.telephony" android:required="false"/>
<uses-feature android:name="android.hardware.microphone" android:required="false"/>
<uses-featu
@AlexanderWillner
AlexanderWillner / icloud-album-download.sh
Created June 18, 2019 17:12 — forked from fay59/icloud-album-download.sh
Download entire iCloud shared albums
#!/bin/bash
# Description: Downloads Web Albums shared by Apple Photos
# Requirements: jq
# Usage: ./icloud-album-download.sh <URL> [<target folder>]
# Source: https://gist.github.com/AlexanderWillner/b8124af1979e88d4046987c953b8260f
# Author: @zneak, @WildDIC, @AlexanderWillner
if [[ -z "$1" ]]; then
echo "Syntax: $0 <URL> [<target folder>]" >&2
@DasWolke
DasWolke / microservice bots.md
Last active June 11, 2024 18:16
Microservice bots

Microservice Bots

What they are and why you should use them

Introduction

Recently more and more chatbots appear, the overall chatbot market grows and the platform for it grows as well. Today we are taking a close look at what benefits creating a microservice chatbot on Discord - (a communication platform mainly targeted at gamers) would provide.

The concepts and ideas explained in this whitepaper are geared towards bots with a bigger userbase where the limits of a usual bot style appear with a greater effect

Information about Discord itself

(If you are already proficient with the Discord API and the way a normal bot works, you may skip ahead to The Concept)

@Lakshanz
Lakshanz / limit-tc.sh
Last active June 4, 2024 03:10
TC limiting : Helps to set maximum upload/download speed limit to your linux server/pc's selected network interface.
#!/bin/bash
# Full path to tc binary
TC=$(which tc)
#
# NETWORK CONFIGURATION
# interface - name of your interface device
# interface_speed - speed in mbit of your $interface
# ip - IP address of your server, change this if you don't want to use
@montanaflynn
montanaflynn / streamer.js
Created January 27, 2015 19:38
Streaming a response with Express.js
var express = require('express')
var app = express()
app.listen(1337)
app.all('/stream/:chunks', function (req, res, next) {
res.writeHead(200, {
'Content-Type': 'text/plain',
@grenade
grenade / 01-generate-ed25519-ssh-key.sh
Last active June 18, 2024 05:42
generate ed25519 ssh and gpg/pgp keys and set file permissions for ssh keys and config
#!/bin/bash
# generate new personal ed25519 ssh key
ssh-keygen -o -a 100 -t ed25519 -f ~/.ssh/id_ed25519 -C "rob thijssen <rthijssen@gmail.com>"
# generate new host cert authority (host_ca) ed25519 ssh key
# used for signing host keys and creating host certs
ssh-keygen -t ed25519 -f manta_host_ca -C manta.network
eval "$(ssh-agent -s)"
@scaryguy
scaryguy / change_primary_key.md
Last active June 9, 2024 22:58
How to change PRIMARY KEY of an existing PostgreSQL table?
-- Firstly, remove PRIMARY KEY attribute of former PRIMARY KEY
ALTER TABLE <table_name> DROP CONSTRAINT <table_name>_pkey;
-- Then change column name of  your PRIMARY KEY and PRIMARY KEY candidates properly.
ALTER TABLE <table_name> RENAME COLUMN <primary_key_candidate> TO id;
@chitchcock
chitchcock / 20111011_SteveYeggeGooglePlatformRant.md
Created October 12, 2011 15:53
Stevey's Google Platforms Rant

Stevey's Google Platforms Rant

I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.

I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't real