This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# source: http://richardkmiller.com/925/script-to-enabledisable-socks-proxy-on-mac-os-x | |
disable_proxy() | |
{ | |
sudo networksetup -setsocksfirewallproxystate Wi-Fi off | |
echo "SOCKS proxy disabled." | |
} | |
trap disable_proxy INT | |
sudo networksetup -setsocksfirewallproxy Wi-Fi 127.0.0.1 9999 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Very quick hack to use `grasp` for searching js tokens in emacs. | |
;; Uses (compile) so when you get search results you can quickly step through them with (next-error) and (previous-error) | |
;; to install: | |
;; $ npm install -g grasp strip-ansi | |
(defun grasp-current-buffer (arg) | |
(interactive "MGrasp: ") | |
(compile (concat "grasp -H '" arg "' " (buffer-file-name) " | strip-ansi"))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias encrypt="openssl enc -aes-256-cbc -a -salt" | |
alias decrypt="openssl enc -d -aes-256-cbc -a -salt" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
/usr/local/share/npm/bin/jslint --browser --continue --devel --node --nomen --sloppy --vars --white --es5 false $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class UrlShortener { | |
const API_URL = 'http://api.bitly.com/v3/shorten'; | |
private $_config; | |
function __construct ($config) { | |
$this->_config = $config; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#### | |
## path | |
export PATH='$HOME/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/git/bin:/usr/local/share/npm/bin' | |
#### | |
## bash | |
alias ll='ls -halG' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## source: https://github.com/hij1nx/dotfiles/blob/master/.osx | |
# Enable the 2D Dock | |
defaults write com.apple.dock no-glass -bool true | |
# Automatically hide and show the Dock | |
defaults write com.apple.dock autohide -bool true | |
# Make Dock icons of hidden applications translucent | |
defaults write com.apple.dock showhidden -bool true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div> | |
<style scoped> | |
& { | |
background: #00F; | |
} | |
span { | |
color #FFF; | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## give me a list of files from the month of May 2011 | |
ls -laht --color=never | egrep 'May[ ]+[0-9]+[ ]+2011(.*)' | sed 's/.*2011 / /' | |
## move them to a separate directory | |
mkdir may-2011; ls -laht --color=never | egrep 'May[ ]+[0-9]+[ ]+2011(.*)' | sed 's/.*2011 / /' | xargs -I {} mv {} may-2011/ |