Skip to content

Instantly share code, notes, and snippets.

@jasonrudolph
jasonrudolph / 00-about-search-api-examples.md
Last active April 30, 2024 19:21
5 entertaining things you can find with the GitHub Search API
@todgru
todgru / starttmux.sh
Last active April 27, 2024 18:17
Start up tmux with custom windows, panes and applications running
#!/bin/sh
#
# Setup a work space called `work` with two windows
# first window has 3 panes.
# The first pane set at 65%, split horizontally, set to api root and running vim
# pane 2 is split at 25% and running redis-server
# pane 3 is set to api root and bash prompt.
# note: `api` aliased to `cd ~/path/to/work`
#
session="work"
@eddyb
eddyb / rustfilt.sh
Last active November 30, 2016 16:22
#!/usr/bin/env bash
SED_SCRIPT=`echo '{\
s/_\\$/$/g;\
s/\\$BP\\$/\&/g;\
s/\\$SP\\$/\@/g;\
s/\\$LT\\$/</g;\
s/\\$GT\\$/>/g;\
s/\\$LP\\$/(/g;\
s/\\$RP\\$/)/g;\
s/\\$RF\\$/\\&/g;\
@kazuho
kazuho / thundering-herd.pl
Last active February 8, 2023 03:46
thundering herd checker for select-accept pattern
#! /usr/bin/perl
#
# to test:
# 1) run this script with either "accept" or "select-accept" as the argument
# (the script listens to 127.0.0.1:12345)
# 2) telnet localhost 12345
# 3) if you see "accept failed", there is the thundering herd problem
#
#
use strict;
@14427
14427 / hkt.rs
Last active February 7, 2024 10:18
Higher-kinded type trait
use std::rc::Rc;
trait HKT<U> {
type C; // Current type
type T; // Type with C swapped with U
}
macro_rules! derive_hkt {
($t:ident) => {
impl<T, U> HKT<U> for $t<T> {
@NickSto
NickSto / session-recover.py
Created November 28, 2017 05:28
Python 3 script to recover your tabs from a Session Manager .session file.
#!/usr/bin/env python3
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
from __future__ import unicode_literals
import sys
import json
import errno
import argparse
@Silverbaq
Silverbaq / Server.kt
Created January 1, 2018 21:15
A simple socket-server written in Kotlin
package dk.im2b
import java.io.OutputStream
import java.net.ServerSocket
import java.net.Socket
import java.nio.charset.Charset
import java.util.*
import kotlin.concurrent.thread
@Centril
Centril / await.md
Last active April 30, 2019 13:52
Centril's views on the "Await Syntax Write Up"

Centril's views on the "Await Syntax Write Up"

in our opinion this — which we will call the "error handling problem” — remains the primary problem that we are trying to resolve.

I don't agree that this is the primary problem; it's one of many problems to resolve; Chaining (and thus not forcing temporaries), general composability, and working well with IDEs is among notable problems.

Syntactic Sugar Solution:

I think it is a stretch to call this syntactic sugar in the first place. The syntax await? is composing await + ?. In my view this is not enough semantic compression to be deserving of the description "syntactic sugar".