Skip to content

Instantly share code, notes, and snippets.

@pymen
pymen / gist:7972623
Created December 15, 2013 12:47 — forked from nummi/gist:47474
function cd() { builtin cd $1 && ls }
function pman() { man -t "${1}" | open -f -a /Applications/Preview.app }
function preview() { open -a Preview $* }
# Force 'sudo zsh' to start root as a loging shell to
# avoid problems with environment clashes
function sudo() {
if [[ $1 = "zsh" ]]; then
#!/bin/bash
# virtualenv-auto-activate.sh
#
# Installation:
# Add this line to your .bashrc or .bash-profile:
#
# source /path/to/virtualenv-auto-activate.sh
#
# Go to your project folder, run "virtualenv .venv", so your project folder
# has a .venv folder at the top level, next to your version control directory.
#!/bin/bash
# virtualenv-auto-activate.sh
#
# Installation:
# Add this line to your .bashrc or .bash-profile:
#
# source /path/to/virtualenv-auto-activate.sh
#
# Go to your project folder, run "virtualenv .venv", so your project folder
# has a .venv folder at the top level, next to your version control directory.
@pymen
pymen / virtualenv.zsh
Created December 15, 2013 13:05 — forked from tek/virtualenv.zsh
virtualEnv with zsh hooks
typeset -A virtualenv_map
virtualenv_map=()
for file in ~/.virtualenvs/*/.project(N)
virtualenv_map[${file:h:t}]=$(<$file)
virtualenv_chpwd()
{
setopt local_options no_auto_pushd
local project_path longest_path new_venv
if [[ $ZSH_SUBSHELL == 0 ]] && \
@pymen
pymen / adblock.sh
Last active August 29, 2015 14:14 — forked from teffalump/README.md
#!/bin/sh
#Put in /etc/adblock.sh
#Block ads, malware, etc.
# Only block wireless ads? Y/N
ONLY_WIRELESS="N"
# IPv6 support? Y/N
IPV6="N"
//oauth2 auth
chrome.identity.getAuthToken(
{'interactive': true},
function(){
//load Google's javascript client libraries
window.gapi_onload = authorize;
loadScript('https://apis.google.com/js/client.js');
}
);
#!/bin/bash
# This script will help you setup Docker for TLS authentication.
# Run it passing in the arguement for the FQDN of your docker server
#
# For example:
# ./create-docker-tls.sh myhost.docker.com
#
# The script will also create a profile.d (if it exists) entry
# which configures your docker client to use TLS
#
@pymen
pymen / chrome.md
Last active August 29, 2015 14:22 — forked from 0xjjpa/chrome.md

#Introduction

Developing Chrome Extensions is REALLY fun if you are a Front End engineer. If you, however, struggle with visualizing the architecture of an application, then developing a Chrome Extension is going to bite your butt multiple times due the amount of excessive components the extension works with. Here are some pointers in how to start, what problems I encounter and how to avoid them.

Note: I'm not covering chrome package apps, which although similar, work in a different way. I also won't cover the page options api neither the new brand event pages. What I explain covers most basic chrome applications and should be enough to get you started.

Table of Contents

  1. Understand the Chrome Architecture
  2. Understand the Tabs-Extension Relationship
  3. Picking the right interface for the job

Selenium with Python

Author: Baiju Muthukadan
Email:baiju.m.mail AT gmail.com
Version: 0.3.2
@pymen
pymen / whiteboardCleaner.md
Created March 22, 2018 14:45 — forked from lelandbatey/whiteboardCleaner.md
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results