Skip to content

Instantly share code, notes, and snippets.

View dangh's full-sized avatar
🤖
I may be slow to respond.

Dang dangh

🤖
I may be slow to respond.
View GitHub Profile
@kettanaito
kettanaito / Dockerfile
Last active January 29, 2025 10:33
Puppeteer in 🐋 Docker
FROM node:22-slim as base
# Skip downloading Chromium as we are installing it manually.
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
# Point Puppeteer at the manually installed executable.
ENV PUPPETEER_EXECUTABLE_PATH="/usr/bin/google-chrome"
# Install Google Chrome Stable and fonts
# Note: this installs the necessary libs to make the browser work with Puppeteer.
@magnetikonline
magnetikonline / README.md
Last active March 29, 2025 09:41
Install AWS CLI v2 from source.

Install AWS CLI v2 from source

Bash script to install the latest released version of the AWS CLI v2 from the distrubuted source.

Using this method to exectue the CLI under a MacBook M1 laptop as a native ARM binary - rather than falling back to Rosetta. Currently the offically packaged macOS .pkg doesn't support both Intel/M1 architectures.

Script designed to be re-run - will blow away an existing install and re-install the latest available version.

Note

This install script assumes you have installed a suitable version of Python 3 - has been tested against:

@mhucka
mhucka / gist:59e785a315d813d14cd0258b89a2fcac
Last active March 27, 2025 19:29
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 <[email protected]>
# @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
@avindra
avindra / Reset-Alacritty.md
Last active November 20, 2024 01:50
Reset Terminal

Introduction

To reset your terminal, you can call reset from your shell, which is generally included with the target operating systems.

If you want to reset when you are not at a shell prompt (i.e., inside some other application), we can send an escape sequence in another way.

As an example, we can send a special escape sequence to the Nth tty:

echo -e "\ec" &gt; /dev/pts/$N
@OdatNurd
OdatNurd / .python-version
Last active July 8, 2024 03:37
Browse all Sublime Text commands provided by plugins
3.8
<!--
Put this file in ~/Library/LaunchAgents/com.example.KeyRemapping.plist to
automatically remap your keys when macOS starts.
See https://developer.apple.com/library/archive/technotes/tn2450/_index.html for
the key "usage IDs". Take the usage ID and add 0x700000000 to it before putting it
into a source or destination (HIDKeyboardModifierMappingSrc and
HIDKeyboardModifierMappingDst respectively).
-->
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
@jpbarto
jpbarto / simple_sklearn_transformer.py
Created June 20, 2019 08:05
Simple SKLearn script to transform some inputs using the SKLearn Estimator on Amazon SageMaker
import pandas as pd
import numpy as np
import argparse
from sklearn import preprocessing
import pickle
import os
from io import StringIO
from sagemaker_containers.beta.framework import (
content_types, encoders, env, modules, transformer, worker)
@thundernixon
thundernixon / set-is_fixed_pitch-to_true.sh
Last active June 22, 2023 07:16
A shell script to update 'isFixedPitch' attribute 'value' from 0 to 1 on OpenType POST table. Also updates the font version.
# requires XMLstarlet: https://brewformulas.org/Xmlstarlet
# requires gftools: pip install git+https://github.com/googlefonts/gftools
# updates isFixedPitch attribute 'value' from 0 to 1 on OpenType POST table
#
# USAGE:
# TTX a file in the family to see its current version number in nameID 5
# $ ttx -t name <font_path>
# then, on the command line, run:
# $ chmod +x <relative_path>/set-is_fixed_pitch.sh
@miyaokamarina
miyaokamarina / conditions.js
Last active March 9, 2023 15:31
Type-level conditions in Flow https://is.gd/OPsJBd
// Licensed under CC BY 4.0.
type $If<X: boolean, Then, Else = empty> = $Call<
& ((true, Then, Else) => Then)
& ((false, Then, Else) => Else),
X,
Then,
Else,
>;

In this tutorial we're going to build a set of parser combinators.

What is a parser combinator?

We'll answer the above question in 2 steps.

  1. What is a parser?
  2. and, what is a parser combinator?

So first question: What is parser?