Skip to content

Instantly share code, notes, and snippets.

@mislav
mislav / fat-logfiles.sh
Last active June 6, 2025 19:18
Find "*.log" files in your home dir, sort them by fattest-first, and calculate the size of them all together.
find ~ -name '*.log' -print0 | xargs -0 -L1 stat -f'%z %N' | sort -rn | tee fat-logfiles.txt | head
awk '{ total += $1 } END { printf "total: %5.2f MiB\n", total/1024/1024 }' < fat-logfiles.txt
$nonpareille: 8px!default;
$minion: 9px!default;
$petit: 11px!default;
$bourgeois: 12px!default;
$long-primer: 13px!default;
$small-pica: 15px!default;
$pica: 16px!default;
$english: 19px!default;
$columbian: 21px!default;
$great-primer: 24px!default;
@jonathan-beebe
jonathan-beebe / vundle_swift_vim_instructions.md
Last active November 30, 2021 16:24
Using Apple’s Swift vim plugin with Vundle

Source of original vim config: https://github.com/apple/swift/tree/master/utils/vim

# use `svn checkout…` to grab just the subfolder from github
svn checkout https://github.com/apple/swift/trunk/utils/vim
# rename to something a bit more specific
mv vim vim-swift
cd vim-swift
rm -rf .svn
# init git
@danielberkompas
danielberkompas / scheduler.ex
Created October 26, 2016 17:59
A simple mix task scheduler for Elixir apps
defmodule MyApp.Scheduler do
@moduledoc """
Schedules a Mix task to be run at a given interval in milliseconds.
## Options
- `:task`: The name of the Mix task to run.
- `:args`: A list of arguments to pass to the Mix task's `run/1` function.
- `:interval`: The time interval in millisconds to rerun the task.
@kez
kez / slugify.sql
Created May 13, 2019 14:50 — forked from ianks/slugify.sql
Generating Slugs in Postgres
CREATE EXTENSION IF NOT EXISTS "unaccent"
CREATE OR REPLACE FUNCTION slugify("value" TEXT)
RETURNS TEXT AS $$
-- removes accents (diacritic signs) from a given string --
WITH "unaccented" AS (
SELECT unaccent("value") AS "value"
),
-- lowercases the string
"lowercase" AS (
@myobie
myobie / slugify.sql
Created June 1, 2019 16:19 — forked from kez/slugify.sql
Generating Slugs in Postgres
CREATE EXTENSION IF NOT EXISTS "unaccent"
CREATE OR REPLACE FUNCTION slugify("value" TEXT)
RETURNS TEXT AS $$
-- removes accents (diacritic signs) from a given string --
WITH "unaccented" AS (
SELECT unaccent("value") AS "value"
),
-- lowercases the string
"lowercase" AS (
@myobie
myobie / now.yml
Last active January 7, 2020 14:50
Zeit's now preview and prod deploy Actions Workflow – emulates how Zeit's Now GitHub integration works, but is even better because it forces a rebuild even if the source code hasn't changed
name: now
on:
push:
jobs:
deploy-prod:
name: Deploy prod
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
steps: