Skip to content

Instantly share code, notes, and snippets.

@badsyntax
badsyntax / android_emulator_cli_ci.md
Last active May 3, 2024 04:01
start an android emulator with screen dimensions (specifically for use in CI)
# Install AVD files
yes | $ANDROID_HOME/tools/bin/sdkmanager --install 'system-images;android-29;default;x86'
yes | $ANDROID_HOME/tools/bin/sdkmanager --licenses

# Create emulator
echo "no" | $ANDROID_HOME/tools/bin/avdmanager create avd -n Pixel_API_29_AOSP -d pixel --package 'system-images;android-29;default;x86' --force

$ANDROID_HOME/emulator/emulator -list-avds
@sindresorhus
sindresorhus / esm-package.md
Last active April 24, 2025 06:11
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.
@prologic
prologic / LearnGoIn5mins.md
Last active February 12, 2025 06:52
Learn Go in ~5mins
@PhiSYS
PhiSYS / multiple-gource.sh
Last active December 21, 2022 04:23
Create multiple repositories visualization video using gource and ffmpeg
#!/usr/bin/bash
declare -a repos=(
"$HOME/Projects/myproject/testing/.git"
"$HOME/Projects/myproject/testing-bundle/.git"
"$HOME/Projects/myproject/service-skeleton/.git"
"$HOME/Projects/myproject/documentation-web/.git"
"$HOME/Projects/myproject/documentation-api/.git"
"$HOME/Projects/myproject/coding-standard/.git"
"$HOME/Projects/myproject/context/microservice1/.git"
@htuscher
htuscher / microk8s.md
Last active April 24, 2023 12:01
MicroK8s on Hetzner Cloud

Installation

apt-get install snapd
snap install microk8s --classic --channel=1.18/stable
microk8s enable dns dashboard registry helm3 ingress storage

Dashboard

@ahasbini
ahasbini / Logger.java
Created October 12, 2019 13:37
Logger wrapper to show Gradle plugin logs in quite mode for effortless development and debugging
import org.gradle.api.logging.LogLevel;
import org.gradle.api.logging.Logging;
import org.slf4j.Marker;
/**
* Created by ahasbini on 11-Oct-19.
*/
public class Logger implements org.gradle.api.logging.Logger {
private static boolean useQuietLogs = false;
@julienma
julienma / README.md
Last active November 10, 2021 13:04
How to install Discourse 2.4+ on Dokku (2019)
@mrk-han
mrk-han / emulator-install-using-avdmanager.md
Last active March 13, 2025 16:33
Installing and creating Emulators with AVDMANAGER (For Continuous Integration Server or Local Use)

Install and Create Emulators using AVDMANAGER and SDKMANAGER

TL;DR

For an emulator that mimics a Pixel 5 Device with Google APIs and ARM architecture (for an M1/M2 Macbook):

  1. List All System Images Available for Download: sdkmanager --list | grep system-images

  2. Download Image: sdkmanager --install "system-images;android-30;google_atd;arm64-v8a"

@ckpearson
ckpearson / howto.md
Created January 30, 2019 00:51
Configuring ASP.NET Core HTTPS with a self-signed CA root & cert for iOS development on OSX

The Problem

ASP.NET core has a very useful dev-certs utility capable of producing self-signed certificates for local https development work.

This works for the most-part, but as soon as you start wanting to do local development of a native app, iOS refuses to trust the certificate, or indeed, to even let you tell it to trust it.

You can see This Issue for some more context.

The Solution

This is what worked for me, I make no guarantees as to its efficiency or ongoing efficacy.

@sebmarkbage
sebmarkbage / The Rules.md
Last active April 12, 2025 17:55
The Rules of React

The Rules of React

All libraries have subtle rules that you have to follow for them to work well. Often these are implied and undocumented rules that you have to learn as you go. This is an attempt to document the rules of React renders. Ideally a type system could enforce it.

What Functions Are "Pure"?

A number of methods in React are assumed to be "pure".

On classes that's the constructor, getDerivedStateFromProps, shouldComponentUpdate and render.