Skip to content

Instantly share code, notes, and snippets.

@eungju
eungju / I18n.kt
Last active March 28, 2024 14:19
Simple i18n
interface I18n {
fun localized(languageTag: String): Localized
interface Localized {
fun text(key: String, args: Map<String, Any>): String
fun text(key: String): String = text(key, emptyMap())
}
}
@Aries0d0f
Aries0d0f / download.sh
Last active June 10, 2025 01:51
Download all macOS Sonoma Aerial wallpaper
#!/bin/zsh
# This script helps those who want to
# get all Aerial wallpapers on macOS Sonoma
# all at once instead of clicking on settings one by one.
# Dependencies: jq, parallel
# Install all dependencies via `brew install jq parallel`
# After `parallel` installed run `sudo parallel --citation` first to read citation notice (IMPORTANT)
@akrylysov
akrylysov / README.md
Last active October 2, 2024 17:32
Fast Intel-on-ARM Docker on macOS with Lima and Rosetta

macOS 13 Ventura introduced support of running amd64 binaries with Rosetta inside of arm64 Linux VMs when using Apple Virtualization framework.

Lima VM v0.14.0 and later support the new feature.

Setup:

# Install Docker client and Lima
brew install docker docker-compose docker-credential-helper lima
@jramnai
jramnai / tutor_openedx_commands.md
Last active January 22, 2025 13:26
Useful command of Tutor Open edX

Tutor Open edX useful commands

Tutor Installation

Requirements

  • Docker: v18.06.0+
  • Docker Compose: v1.22.0+
  • Ports 80 and 443 should be open
  • Hardware:
  • Minimum configuration: 4 GB RAM, 2 CPU, 8 GB disk space
@mytory
mytory / make-url-clickable-without-a-tag.php
Last active October 19, 2021 13:13
URL을 링크로 바꿔 주는데, 이미 링크가 걸린 a 태그는 건드리지 않는다.
<?php
/**
* 아래는 참고한 자료.
* @link https://stackoverflow.com/questions/24651869/regex-matching-links-without-a-tag/24653720?stw=2#24653720
*/
function make_link_clickable($text)
{
return preg_replace(
'!<a(.|\n)*?</a>(*SKIP)(*F)|' //skip a tag
. '(((f|ht)tp(s)?://)[-a-zA-Zа-яА-Я()0-9@:%_+.~#?&;/=]+)!i',
@joepie91
joepie91 / es-modules-are-terrible-actually.md
Last active June 10, 2025 02:07
ES Modules are terrible, actually

ES Modules are terrible, actually

This post was adapted from an earlier Twitter thread.

It's incredible how many collective developer hours have been wasted on pushing through the turd that is ES Modules (often mistakenly called "ES6 Modules"). Causing a big ecosystem divide and massive tooling support issues, for... well, no reason, really. There are no actual advantages to it. At all.

It looks shiny and new and some libraries use it in their documentation without any explanation, so people assume that it's the new thing that must be used. And then I end up having to explain to them why, unlike CommonJS, it doesn't actually work everywhere yet, and may never do so. For example, you can't import ESM modules from a CommonJS file! (Update: I've released a module that works around this issue.)

And then there's Rollup, which apparently requires ESM to be u

Table definition

CREATE TABLE countries (
  id INT NOT NULL AUTO_INCREMENT,
  iso VARCHAR(2) NOT NULL,
  iso3 VARCHAR(3) NOT NULL,
  iso_numeric INT NOT NULL,
  country_name VARCHAR(64) NOT NULL,
 capital VARCHAR(64) NOT NULL,
@avoidik
avoidik / README.md
Created April 24, 2021 18:16
How to Limit CPU and Memory Usage With Cgroups on Debian/Ubuntu

How to Limit CPU and Memory Usage With Cgroups on Debian/Ubuntu

Cgroups is a flexible Linux kernel feature to limit, police and account resources usage. A cgroup is a set of tasks for a subsystems, that is typically a resource controller.

A file system of type cgroup is mounted and all operations are run over it.

Installation

The installation can be done using any of libcgroup, cgmanager or systemd.

@mrtns
mrtns / README.md
Last active February 13, 2023 14:26
Data Landscape 2021

201x BI tools

SaaS

Acquired

  • BIME
    • Acquired by Zendesk October 2015