Skip to content

Instantly share code, notes, and snippets.

@blalor
blalor / brewviz.sh
Created July 27, 2016 10:39
homebrew dependency tree with graphviz
#!/bin/bash
set -e -u -o pipefail
{
echo 'digraph G {'
brew list | while read cask; do
printf '"%s";\n' $cask
brew deps $cask | while read dep; do
@andriisoldatenko
andriisoldatenko / latency.txt
Last active February 18, 2018 07:16 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers
--------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@michaelvillar
michaelvillar / .zshrc
Created August 25, 2016 00:19
Get a OS X Notification when a slow CLI command finishes
# Based on http://frantic.im/notify-on-completion and https://gist.github.com/jamesmacaulay/860763
# Notify on completion
function f_notifyme {
LAST_EXIT_CODE=$?
CMD=$(fc -ln -1)
terminal-notifier -title "$CMD" -message "Status code: $LAST_EXIT_CODE" &
}
save_preexec_time() {
export PREEXEC_CMD="$(history | tail -1 | sed 's/ *[0-9]* *//')"
@minniel
minniel / slack_history.py
Last active February 28, 2022 22:02 — forked from Chandler/slack_history.py
Download Slack Channel/PrivateChannel/DirectMessage History
from slacker import Slacker
import json
import argparse
import os
import shutil
import copy
from datetime import datetime
# This script finds all channels, private channels and direct messages
# that your user participates in, downloads the complete history for
@mxwright
mxwright / instarss.php
Last active May 19, 2021 15:45 — forked from jonathanbell/Instarss.md
Make a RSS feed from an Instagram user's username.
<?php
if (!isset($_GET['user'])) {
if (!isset($_GET['hashtag'])) {
exit('Not a valid RSS feed. You didn\'nt provide an Instagram user or hashtag. Send one via a GET variable. Example .../instarss.php?user=snoopdogg');
}
}
if (isset($_GET['user']) && isset($_GET['hashtag'])) {
exit('Don\'t request both user and hashtag. Request one or the other.');
@scottopell
scottopell / fix_exfat_drive.md
Last active April 28, 2025 01:04
Fix corrupted exFAT disk macOS/OSX

exFAT support on macOS seems to have some bugs because my external drives with exFAT formatting will randomly get corrupted.

If Disk Utility is unable to repair, consider trying this:

  1. In Disk Utility, ensure that the drive is not mounted, eject it if it is mounted.
  2. Use diskutil list to find the right drive id.
  3. You want the id under the IDENTIFIER column, it should look like disk1s1
  4. Run sudo fsck_exfat -d <id from above>. eg sudo fsck_exfat -d disk1s3
  5. -d is debug so you'll see all your files output as they're processed.
@thefish
thefish / klavaorg-telegram-links.md
Last active January 10, 2018 14:42
Klava.org - Полезные ссылки для Телеграм-чата
@cedricziel
cedricziel / migrate.sh
Created January 12, 2017 09:11
Very simple migration script to move from gitlab to gogs
#!/bin/env bash
## Needs `jq` (https://stedolan.github.io/jq/) on PATH
## and a personal gogs token of yours.
## Obtain token from https://git.example.com/user/settings/applications
## Usage:
## ./migrate.sh $clone_url $project_name [$optional_group]
## Migrate a repository to gogs into the user namespace of the token-user
## ./migrate.sh [email protected]:group/repo.git repo
## Migrate a repository to gogs into the group namespace `group` (needs to exist)
@nicinabox
nicinabox / lets split build guide.md
Last active January 28, 2023 04:10
This guide covers building a Let's Split v2.

This guide has moved

To improve collaboration this guide is now available on GitHub.

Continue reading