Skip to content

Instantly share code, notes, and snippets.

@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

@iansedano
iansedano / get_token.sh
Last active April 30, 2024 15:36
Google OAuth flow bash script
#!/bin/bash
# Usage
#
# . get_token.sh [CLIEND_ID] [CLIENT_SECRET] [SCOPE]
#
# Script will prompt you to visit a url to get the auth code,
# and wait for you to provide them and then output the tokens.
@toricls
toricls / Dockerfile
Last active April 26, 2023 23:49
Docker-in-Docker with Amazon Linux 2 Container
FROM amazonlinux:2
RUN yum -y update \
# systemd is not a hard requirement for Amazon ECS Anywhere, but the installation script currently only supports systemd to run.
# Amazon ECS Anywhere can be used without systemd, if you set up your nodes and register them into your ECS cluster **without** the installation script.
&& yum -y install systemd \
&& yum clean all
RUN cd /lib/systemd/system/sysinit.target.wants/; \
for i in *; do [ $i = systemd-tmpfiles-setup.service ] || rm -f $i; done
@greim
greim / soft-model.js
Created April 3, 2012 19:09
Backbone.SoftModel
/**
Extend Backbone.SoftModel and then bind to the 'soft:change' event.
It will only fire once given a sequence of rapid-fire changes.
This avoids for example having multiple redundant renders,
which can be a performance killer. That way you don't have to
splatter your code with speculative {silent:true}s.
Warning!
This code is untested. This is just exploring an idea.
*/
function testFont(name) {
name = name.replace(/['"<>]/g,'');
var body = document.body,
test = document.createElement('div'),
installed = false,
template =
'<b style="display:inline !important; width:auto !important; font:normal 10px/1 \'X\',sans-serif !important">ii</b>'+
'<b style="display:inline !important; width:auto !important; font:normal 10px/1 \'X\',monospace !important">ii</b>',
ab;