Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@umayr
umayr / interface-example.ts
Created August 29, 2016 19:49
An Interface example for TypeScript
interface IFunc {
(n: number[]): number;
}
interface IOperations {
add: IFunc;
sub: IFunc;
mul: IFunc;
div: IFunc;
}
@umayr
umayr / vimdiff.md
Created May 5, 2016 14:09 — forked from mattratleph/vimdiff.md
vimdiff cheat sheet

vimdiff cheat sheet

##git mergetool

In the middle file (future merged file), you can navigate between conflicts with ]c and [c.

Choose which version you want to keep with :diffget //2 or :diffget //3 (the //2 and //3 are unique identifiers for the target/master copy and the merge/branch copy file names).

:diffupdate (to remove leftover spacing issues)

:only (once you’re done reviewing all conflicts, this shows only the middle/merged file)

@umayr
umayr / orhttp_example.go
Created April 24, 2016 15:32 — forked from Yawning/orhttp_example.go
How to dispatch HTTP requests via Tor in Go.
// To the extent possible under law, the Yawning Angel has waived all copyright
// and related or neighboring rights to orhttp_example, using the creative
// commons "cc0" public domain dedication. See LICENSE or
// <http://creativecommons.org/publicdomain/zero/1.0/> for full details.
package main
import (
// Things needed by the actual interface.
"golang.org/x/net/proxy"
@umayr
umayr / recover-deleted-branch.sh
Created April 1, 2016 11:41
How to recover a deleted branch
## Pre-requisite: You have to know your last commit message from your deleted branch.
git reflog
# Search for message in the list
# a901eda HEAD@{18}: commit: <last commit message>
# Now you have two options, either checkout revision or HEAD
git checkout a901eda
# Or
git checkout HEAD@{18}
@umayr
umayr / tmux-install.sh
Created January 22, 2016 10:12
How to install latest tmux with 256 color support in Ubuntu.
sudo apt-get update
sudo apt-get install ncurses-dev libevent-dev
git clone https://github.com/sunaku/tmux.git
cd tmux
git checkout 24bit-color
sh autogen
./configure && sudo make install
@umayr
umayr / README
Last active August 31, 2015 05:57 — forked from duksis/README
Wi-Fi Protected Setup vulnerability VU#723755 brute force attack implementation in Python
PoC implementation of a brute force attack against WPS - PIN External Registrar
My test environment was Backtrack 5R1 + an Atheros USB adapter.
I used a mac80211/carl9170 driver but any mac80211-based driver should be ok.
DEPENDENCIES:
PyCrypto
Scapy (2.2.0) (does not come with Backtrack)
USAGE:
@umayr
umayr / The Technical Interview Cheat Sheet.md
Last active August 29, 2015 14:28 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
@umayr
umayr / uranus.js
Last active August 29, 2015 14:27
API for validating a complete object via uranus.
var Uranus = require('uranus');
var validator = new Uranus();
var obj = {
firstName: 'umayr',
lastName: 'shahid',
email: 'umayr.shahid@tenpearls.com'
};
var rules = {
@umayr
umayr / GIF-Screencast-OSX.md
Last active August 29, 2015 14:25 — forked from dergachev/GIF-Screencast-OSX.md
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

Finishing this guide you'll get:

  • A running WordPress installation
  • Nginx proxy with PHP and Fast CGI
  • MySQL server accessible with phpMyAdmin

Specification of latest running installation:

  • Date: 03.03.2014