Skip to content

Instantly share code, notes, and snippets.

@bds
bds / gist:3a92e6c0e2aa3ea60c24
Created March 24, 2016 22:25
ngrep examples
sudo ngrep -q -T -W byline host api.zuora.com
sudo ngrep -q -T -W byline port 27017

Keybase proof

I hereby claim:

  • I am bds on github.
  • I am bds (https://keybase.io/bds) on keybase.
  • I have a public key ASB4Evif_EDD-524nYlYchAx214Pa2eHhrGmrq7u7Lt8sgo

To claim this, I am signing this object:

@bds
bds / codepoint.rb
Last active March 10, 2017 23:55
Ruby codepoints
puts ("2070".."2090").map {|i| [i.hex].pack("U"); }

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@bds
bds / pip.md
Created February 21, 2018 03:22 — forked from saurabhshri/pip.md
Install and use pip in a local directory without root/sudo access.

#Install and use pip in a local directory without root/sudo access. #####By: @saurabhshri

##Why? Many users when are given server access, do not have root (or sudo) privileges and can not simply do sudo apt-get install python-pip . Here's an easy way you can install and use pip without root (or sudo) access in a local directory. Note : This works without easy_install too.

##How?

@bds
bds / rules for good testing.md
Created April 11, 2018 20:06 — forked from Integralist/rules for good testing.md
Sandi Metz advice for writing tests

Rules for good testing

Look at the following image...

...it shows an object being tested.

You can't see inside the object. All you can do is send it messages. This is an important point to make because we should be "testing the interface, and NOT the implementation" - doing so will allow us to change the implementation without causing our tests to break.

@bds
bds / inotify-compile.sh
Created September 1, 2018 19:31
Use inotify modify events to compile Crystal Lang
#! /usr/bin/env sh
#
# https://github.com/rvoicilas/inotify-tools/wiki#inotifywait
#
CURPATH=`pwd`
inotifywait -mr \
--exclude "[^c][^r]$" \
--timefmt '%d/%m/%y %H:%M:%S' --format '%T %w %f' \
-e modify /usr/src/app/my-app/src | while read date time dir file; do
@bds
bds / osx-gui-notify.sh
Created September 1, 2018 19:34
OSX GUI notification
osascript -e 'display notification "Lorem ipsum dolor sit amet 2" with title "Title"'
@bds
bds / docker-gdb.sh
Last active September 3, 2018 19:45
Use gdb with Docker
docker run --cap-add=SYS_PTRACE --security-opt seccomp=unconfined
@bds
bds / http_streaming.md
Created September 24, 2018 16:12 — forked from CMCDragonkai/http_streaming.md
HTTP Streaming (or Chunked vs Store & Forward)

HTTP Streaming (or Chunked vs Store & Forward)

The standard way of understanding the HTTP protocol is via the request reply pattern. Each HTTP transaction consists of a finitely bounded HTTP request and a finitely bounded HTTP response.

However it's also possible for both parts of an HTTP 1.1 transaction to stream their possibly infinitely bounded data. The advantages is that the sender can send data that is beyond the sender's memory limit, and the receiver can act on