Skip to content

Instantly share code, notes, and snippets.

Zam zamber

Block or report user

Report or block zamber

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@zamber
zamber / .gitconfig
Created Mar 29, 2018
My global .gitconfig on Windows
View .gitconfig
[user]
name = <name>
email = <user>@<domain>
[merge]
tool = kdiff3
[mergetool "kdiff3"]
path = C:/Program Files/KDiff3/kdiff3.exe
trustExitCode = false
[diff]
guitool = kdiff3
@zamber
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
README.md dotbot gitignore install.conf.yaml zsh
SSH.md gitconfig install tmux.conf zshrc
Useless-Piece-of-ht:dotfiles zamber$ cat README.md
# dotfiles
## Optional SSH key magic
`~.ssh/config`
@zamber
zamber / contenteditable.directive.ts
Last active Feb 23, 2018
Angular 4 contenteditable directive
View contenteditable.directive.ts
/*
based on https://stackoverflow.com/a/40183067/1225741
tested with angular 4.0.3
in your *.component.html:
<span #mycomponentvarthingy [appContenteditableModel]="mycomponentvarthingy"
(appContenteditableModelChange)="myValueChangeEventHandler($event)"></span>
// to trigger editing just set contenteditable to true on the target element ie.
@ViewChild('mycomponentvarthingy') mycomponentvarthingy: ElementRef;
@zamber
zamber / ness.py
Last active Apr 3, 2017
Parse images in directories and spew out sharpness and brightness for each one (as naive CSV)
View ness.py
#!/usr/bin/env python2.7
'''
Based on:
http://www.pyimagesearch.com/2015/09/07/blur-detection-with-opencv/
opencv is available for python2.7 on Ubuntu only (in default repos)
hence pip2 and above hashbang
# Installation
@zamber
zamber / ssh-telegram.sh
Last active Sep 3, 2018 — forked from matriphe/ssh-telegram.sh
Bash Script to notify via Telegram Bot API when user log in SSH
View ssh-telegram.sh
# save it as /etc/profile.d/ssh-telegram.sh
# use sed to parse JSON from ipinfo.io
# you can get your user_id by writing to @get_id_bot
USERID="<target_user_id>"
KEY="<bot_private_key>"
TIMEOUT="10"
URL="https://api.telegram.org/bot$KEY/sendMessage"
DATE_EXEC="$(date "+%d %b %Y %H:%M")"
TMPFILE='/tmp/ipinfo-$DATE_EXEC.txt'
if [ -n "$SSH_CLIENT" ] && [ -z "$TMUX" ]; then
@zamber
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] [hosts=www.google.com]
Google Play services [appId=124] [hosts=android.clients.google.com]
Instagram [appId=66] [hosts=graph.facebook.com]
Icy Drifter [appId=114] [hosts=config.uca.cloud.unity3d.com]
Google Play Store [appId=54] [hosts=android.clients.google.com]
Google Play services [appId=124] [hosts=www.googleapis.com]
e-podróżnik.pl [appId=21] [hosts=www.e-podroznik.pl]
Google+ [appId=104] [hosts=www.googleapis.com]
Messenger [appId=160] [hosts=edge-mqtt.facebook.com]
Fit [appId=115] [hosts=www.googleapis.com]
View keybase.md

Keybase proof

I hereby claim:

  • I am zamber on github.
  • I am zamber (https://keybase.io/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:

@zamber
zamber / Preferences.sublime-settings
Created Oct 4, 2015
My Sublime Text 3 settings.
View Preferences.sublime-settings
{
"binary_file_patterns":
[
".DS_Store",
"node_modules/",
"*.png",
"*.psd",
"*.jpg",
"*.gif",
"*.min.js",
@zamber
zamber / gen-menu.py
Last active Mar 25, 2017
A simple and dirty menu generator for MkDocs. Human sorting, titlecase and automatic numeration.
View gen-menu.py
#!/usr/bin/python
# https://gist.github.com/zamber/af5086cb9c097be5c002
import os
import re
from titlecase import titlecase # pip install titlecase
# Config
root = 'src'
os.chdir(root)
@zamber
zamber / windowprops.sh
Created Jun 10, 2015
Key binding for getting window properties for writing i3-wm `for_window` rules
View windowprops.sh
#!/bin/sh
# Get active window properties for writing `for_window` rules
# In ~/.i3/config:
# bindsym $mod+g ~/.i3/windowprops.sh
NAME=$(xprop -id `xdotool getactivewindow` | grep 'WM_NAME(STRING)')
CLASS=$(xprop -id `xdotool getactivewindow` | grep 'WM_CLASS(STRING)')
notify-send "$NAME
$CLASS"
You can’t perform that action at this time.