Skip to content

Instantly share code, notes, and snippets.

@prologic
prologic / LearnGoIn5mins.md
Last active May 5, 2024 17:05
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 May 1, 2024 21:12
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 May 7, 2024 02:39
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.

@Tanapruk
Tanapruk / activity.java
Created June 23, 2017 04:50
Unfocus EditText when taping outside
edittext.setOnFocusChangeListener(new View.OnFocusChangeListener() {
@Override
public void onFocusChange(View v, boolean hasFocus) {
if (!hasFocus) {
Log.d("focus", "focus loosed");
// Do whatever you want here
} else {
Log.d("focus", "focused");
}
}
@antirez
antirez / lmdb.tcl
Created April 28, 2017 15:40
LMDB -- First version of Redis written in Tcl
# LVDB - LLOOGG Memory DB
# Copyriht (C) 2009 Salvatore Sanfilippo <antirez@gmail.com>
# All Rights Reserved
# TODO
# - cron with cleanup of timedout clients, automatic dump
# - the dump should use array startsearch to write it line by line
# and may just use gets to read element by element and load the whole state.
# - 'help','stopserver','saveandstopserver','save','load','reset','keys' commands.
# - ttl with milliseconds resolution 'ttl a 1000'. Check ttl in dump!