Skip to content

Instantly share code, notes, and snippets.

generated Jan 17, 2023 23:11:59
system MacOS 13.1 Darwin 22.2.0 x86_64
emacs 28.2 ~/.emacs.d/
doom 3.0.0-pre PROFILE=_@0 grafted, HEAD -> master, origin/master,
origin/HEAD e966249 2023-01-01 21:55:13 -0500 ~/.doom.d/
shell /usr/local/bin/zsh
features ACL GIF GLIB GMP GNUTLS IMAGEMAGICK JPEG JSON LCMS2 LIBXML2
MODULES NOTIFY KQUEUE NS PDUMPER PNG RSVG THREADS TIFF
TOOLKIT_SCROLL_BARS XIM XWIDGETS ZLIB
traits batch server-running envvar-file custom-file

Keybase proof

I hereby claim:

  • I am tabuchid on github.
  • I am tabuchid (https://keybase.io/tabuchid) on keybase.
  • I have a public key ASCa_0zZTqq4Di0zzTuhhlZgRExIIUsqHKLbZq9YRFPn-go

To claim this, I am signing this object:

@tabuchid
tabuchid / System Design.md
Created May 2, 2016 15:09 — forked from vasanthk/System Design.md
System Design Cheatsheet

#System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

##Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
/// Observes a run loop to detect any stalling or blocking that occurs.
///
/// This class is thread-safe.
@interface GHRunLoopWatchdog : NSObject
/// Initializes the receiver to watch the specified run loop, using a default
/// stalling threshold.
- (id)initWithRunLoop:(CFRunLoopRef)runLoop;
/// Initializes the receiver to detect when the specified run loop blocks for
@tabuchid
tabuchid / setup.md
Last active August 29, 2015 14:11 — forked from bendyorke/setup.md
// Asynchronously loads UIImages from the given URLs, but throttles the loading
// to keep memory and CPU usage sane.
- (RACSignal *)loadImagesAtURLs:(NSArray *)imageURLs {
// Map each URL to a signal of work. The result is a signal of work signals.
return [[imageURLs.rac_signal
map:^(NSURL *imageURL) {
return [[[[NSURLConnection
// Load the URL asynchronously.
rac_sendAsynchronousRequest:[NSURLRequest requestWithURL:imageURL]]
reduceEach:^(NSURLResponse *response, NSData *data) {
# Our .tmux.conf file
# Setting the prefix from C-b to C-a
# START:prefix
set -g prefix C-a
# END:prefix
# Free the original Ctrl-b prefix keybinding
# START:unbind
unbind C-b
# END:unbind
function gitclean {
current_branch=$(git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/')
if [ "$current_branch" != "master" ]; then
echo "WARNING: You are on branch $current_branch, NOT master."
fi
echo "Fetching merged branches..."
git remote prune origin
remote_branches=$(git branch -r --merged | grep -v '/master$' | grep -v "/$current_branch$")
local_branches=$(git branch --merged | grep -v 'master$' | grep -v "$current_branch$")
if [ -z "$remote_branches" ] && [ -z "$local_branches" ]; then
@tabuchid
tabuchid / gist:2312335
Created April 5, 2012 16:27
Get rid of merged branches
function gitclean(){
git remote prune origin
git branch -a --merged | grep -v master | sed -e 's/.*\//:/g' | xargs git push origin
}
@tabuchid
tabuchid / gist:1299154
Created October 19, 2011 18:07
printer
#include <NewSoftSerial.h>
#include <Thermal.h>
int printer_RX_Pin = 2;
int printer_TX_Pin = 3;
Thermal printer(printer_RX_Pin, printer_TX_Pin);
void setup() {
Serial.begin(9600); // Initialize serial port