Skip to content

Instantly share code, notes, and snippets.

zamber / lambda.js
Created Oct 4, 2020
BitBucket PR creation webhook -> AWS Lambda -> Slack bot
View lambda.js
Used for a bigger team where not everyone is on Slack. A random user from the list is chosen and notified about a PR.
If the user is already set as a reviewer it's discarded from the random pool.
The lambda is the most simple configuration for requests with 128MB of RAM provisioned.
const https = require('https');
zamber /
Last active Dec 6, 2019
How to remove merged branches

How to clean up Git branches

This will take a while to do.

  1. Make a new clone of your repo.

     git clone <repo> <repo>-bak
     cd <repo>-bak
  2. Make a backup of all branches locally in case you fuck up something.

zamber / dirWatch.js
Created Aug 23, 2019
This is a simple, 0-dependency script for debugging watchers. It watches files in a directory and logs changes to the console. That's it. Should work on any OS. Works with absolute and relative paths. Will break on access denied or cyclical symlinks. For debug use only.
View dirWatch.js
#!/usr/bin/env node
const { performance } = require('perf_hooks')
const fs = require('fs')
const path = require('path')
const log = console.log
const warn = console.warn
const err = console.error
const perf_start =
// funcs
zamber / .gitconfig
Created Mar 29, 2018
My global .gitconfig on Windows
View .gitconfig
name = <name>
email = <user>@<domain>
tool = kdiff3
[mergetool "kdiff3"]
path = C:/Program Files/KDiff3/kdiff3.exe
trustExitCode = false
guitool = kdiff3
zamber / bash_to_zsh_w_dotfiles.log
Created Dec 6, 2017
Plain Mac bash -> zsh with dotfiles
View bash_to_zsh_w_dotfiles.log
Useless-Piece-of-ht:~ zamber$ cd Documents/GitHub/dotfiles/
Useless-Piece-of-ht:dotfiles zamber$ ls dotbot gitignore install.conf.yaml zsh gitconfig install tmux.conf zshrc
Useless-Piece-of-ht:dotfiles zamber$ cat
# dotfiles
## Optional SSH key magic
zamber / contenteditable.directive.ts
Last active Feb 23, 2018
Angular 4 contenteditable directive
View contenteditable.directive.ts
based on
tested with angular 4.0.3
in your *.component.html:
<span #mycomponentvarthingy [appContenteditableModel]="mycomponentvarthingy"
// to trigger editing just set contenteditable to true on the target element ie.
@ViewChild('mycomponentvarthingy') mycomponentvarthingy: ElementRef;
zamber /
Last active Apr 3, 2017
Parse images in directories and spew out sharpness and brightness for each one (as naive CSV)
#!/usr/bin/env python2.7
Based on:
opencv is available for python2.7 on Ubuntu only (in default repos)
hence pip2 and above hashbang
# Installation
zamber /
Last active Nov 1, 2019 — forked from matriphe/
Bash Script to notify via Telegram Bot API when user log in SSH
# save it as /etc/profile.d/
# use sed to parse JSON from
# you can get your user_id by writing to @get_id_bot
DATE_EXEC="$(date "+%d %b %Y %H:%M")"
if [ -n "$SSH_CLIENT" ] && [ -z "$TMUX" ]; then
zamber / 1h-dns-leak.log
Created Nov 7, 2016
A 1h sample of having my Android phone idle. Data for DNS leaks (so HTTP and HTTPS).
View 1h-dns-leak.log
Chrome [appId=120] []
Google Play services [appId=124] []
Instagram [appId=66] []
Icy Drifter [appId=114] []
Google Play Store [appId=54] []
Google Play services [appId=124] []
e-podróż [appId=21] []
Google+ [appId=104] []
Messenger [appId=160] []
Fit [appId=115] []

Keybase proof

I hereby claim:

  • I am zamber on github.
  • I am zamber ( on keybase.
  • I have a public key whose fingerprint is 66A2 448B 4B4A 9BDD 521A 188A 57A4 6583 B13F 77F6

To claim this, I am signing this object: