Skip to content

Instantly share code, notes, and snippets.

@kamalmarhubi
kamalmarhubi / SketchSystems.spec
Created March 23, 2020 01:51
# terminated: did not finish survye
# terminated: did not finish survye
# closed: finished survey
# panel: fineshed survey and added to panel
Unassigned*
Open
number pulled -> Pending reach out
Limbo
number pulled -> State?
State?
awaiting reply? -> Awaiting reply
@kamalmarhubi
kamalmarhubi / SketchSystems.spec
Created March 11, 2020 01:00
# terminated: did not finish survye
# terminated: did not finish survye
# closed: finished survey
# panel: fineshed survey and added to panel
Undrawn*
number drawn -> Unassigned
Drawn
Unassigned*
Open
number pulled -> Pending reach out
Limbo
@kamalmarhubi
kamalmarhubi / SketchSystems.spec
Last active February 12, 2019 21:25
Unpaired
Unpaired
connectionTimeout -> InitialState
connectionError -> InitialState
protocolError -> InitialState
pairingTimeout -> InitialState
InitialState*
deviceInitiate -> PendingServerPairingAck
PendingServerPairingAck
serverAck -> PendingClientConfirmation
@kamalmarhubi
kamalmarhubi / rust2018.md
Last active February 1, 2018 03:23
#rust2018

Rust 2018: Rust should be an excellent open source citizen

Here's my late [#rust2018][rust2018] post. I contribute to a lot of projects in a lot of different languages. I think it's really important not to think about Rust in isolation, but in the context of the greater open source world. Here area few specific ways I think about this:

  • ease of contributing to projects in rust
  • interoperability with other languages (both directions)
  • ripgrep should be in debian
  • don't fracture the ecosystem

The rest of this post is going through these in turn.

jfdlksaj
@kamalmarhubi
kamalmarhubi / dump-debuginfo
Last active October 18, 2016 14:04
Dump debug info for an ELF file
#!/bin/bash
set -eou pipefail
me="$(basename $BASH_SOURCE)"
if [ $# -ne 1 ]; then
echo >&2 usage: "$me" /path/to/binary/to/dump
exit 1
fi
@kamalmarhubi
kamalmarhubi / ifconfig-annotated-strace
Last active July 28, 2020 13:55
ifconfig: how does it even?
######## start up crap ########
execve("/sbin/ifconfig", ["ifconfig"], [/* 16 vars */]) = 0
brk(0) = 0xda6000
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f87bbd5d000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=106334, ...}) = 0
mmap(NULL, 106334, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f87bbd43000
{-# LANGUAGE OverloadedStrings #-}
-- The Haskell String type is a linked list of characters, and according to the
-- Haskell Report, literal strings have this type. There are better
-- representations like Data.Text and ByteString, which use packed arrays of
-- characters. OverloadedStrings is a language extension that lets you use
-- sting literals in places where these other representations are expected,
-- without needing conversion functions. In this file, that's happening in the
-- object property getters in parseJson -- (.:) takes a Data.Text, and you want
-- to call it more conveniently with a string literal.
Vagrant.configure("2") do |config|
config.vm.box = "precise32"
config.vm.box_url = "http://files.vagrantup.com/precise32.box"
end
{-# LANGUAGE OverloadedStrings #-}
import qualified Data.Text.Lazy as T
import qualified Data.Text.Lazy.IO as T
import qualified Data.Text.Lazy.Encoding as E
import qualified Data.ByteString.Lazy as L
mtl = "montréal\n" :: T.Text
long = L.cycle $ E.encodeUtf8 mtl
main = L.putStr long