Skip to content

Instantly share code, notes, and snippets.

View yeongsheng-tan's full-sized avatar

Tan Yeong Sheng yeongsheng-tan

View GitHub Profile
@toricls
toricls / lima-on-m1-mac-installation-guide.md
Last active April 25, 2024 15:30
Using Lima to run containers with containerd and nerdctl (without Docker Desktop) on M1 Macs

Lima (Linux virtual machines, on macOS) installation guide for M1 Mac.

Sep. 27th 2021 UPDATED

Now we can install patched version of QEMU via Homebrew (thank you everyone for the info!). Here is the updated instruction with it:

Used M1 Mac mini 2020 with macOS Big Sur Version 11.6.

1. Install QEMU & Lima

@sindresorhus
sindresorhus / esm-package.md
Last active May 4, 2024 15:48
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.
/* eslint-disable @typescript-eslint/no-explicit-any */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
import * as joi from 'joi'
type ArrayType<T> = T extends (infer U)[] ? U : never
declare module 'joi' {
interface Root {
extend(...extensions: Array<joi.Extension | joi.ExtensionFactory>): this
@vilmid
vilmid / install.ps1
Last active May 22, 2023 23:07
Install Apps Using Scoop
$apps_in_main_bucket = @(
'7zip'
'act'
'bat'
'boxes'
'busybox'
'duf'
'dust'
'fd'
'fq'
@Xdeon
Xdeon / frequency.erl
Created July 11, 2020 02:31
frequency server with exceptions
-module(frequency).
-export([start/0, allocate/0, deallocate/1, stop/0, init/0]).
start() ->
Pid = spawn(?MODULE, init, []),
register(?MODULE, Pid),
Pid.
allocate() ->
send_receive(allocate).
@elbrujohalcon
elbrujohalcon / frequency.erl
Created July 7, 2020 14:58
Frequency with Errors
%% @doc Frequency server that "transmits" errors from server to client
-module frequency.
-export [test/0].
-export [start/0, allocate/0, deallocate/1].
-export [init/0].
test() ->
%% Ensure the server is killed... This is ugly
catch exit(whereis(frequency), kill),
% Compile: c(frequency_hardened).
-module(frequency_hardened).
-author("William Vargas").
-version("1.0").
-export([init/0, start/0, stop/0, allocate/0, deallocate/1, tests/0]).
% Register the server as frequency_hardened
-spec start() -> ?MODULE.
start() ->
@gmmoreira
gmmoreira / install.sh
Last active November 1, 2022 15:05
Install Ruby 2.2.x, 2.3.x in Ubuntu 20.04
#!/bin/bash
set -e
# Usage
# ./install.sh # defaults to 2.3.8
# ./install.sh 2.3.3
# Explanation
# Ruby 2.3 or lower only support OpenSSL 1.0.

Phoenix 1.4.x to 1.5.0 upgrade instructions

Phoenix 1.5 requires Elixir >= 1.7. Be sure your existing version is up to date by running elixir -v on the command line.

Install the new phx.new project generator

$ mix archive.uninstall phx_new
$ mix archive.install hex phx_new 1.5.0
@koshatul
koshatul / README.md
Last active April 29, 2024 17:13
use Apple Keychain to store GPG Passphrases

gpg-agent setup

Need to setup gpg-agent first, on OSX I use keychain (it also does ssh-agent)

$ brew info keychain
keychain: stable 2.8.5
User-friendly front-end to ssh-agent(1)
https://www.funtoo.org/Keychain
/usr/local/Cellar/keychain/2.8.5 (7 files, 108.5KB) *