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
For apache virtualhost you just need something simple like this: | |
<VirtualHost *:80> | |
ServerName heroized | |
DocumentRoot /vagrant/heroized | |
<Directory /vagrant/heroized> | |
Options Indexes FollowSymLinks | |
AllowOverride all | |
</Directory> |
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 | |
$parts = secondsToDuration(61); | |
assert($parts['hours'] === 0); | |
assert($parts['minutes'] === 1); | |
assert($parts['seconds'] === 1); | |
assert('PT0H1M1S' === formatDuration($parts)); | |
$parts = secondsToDuration(7202); | |
assert($parts['hours'] === 2); |
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 | |
# Wrapper for "svn status". Shows only files matching the filter | |
# Usage: filterstat [?CMAI] | |
# | |
# source: http://subversion.tigris.org/faq.html#switch-problems | |
filter=$1 | |
svn status --no-ignore | grep ^[${filter}] | sed s/^[${filter}]// |
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/sh | |
svn st -u | grep '*' | sed -E 's/^.*[\*].*[0-9 ]+//' |
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/ |
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
;; turn line numbers off by default | |
(global-linum-mode -1) | |
(defun goto-line-with-feedback (&optional line) | |
"Show line numbers temporarily, while prompting for the line number input" | |
(interactive "P") | |
(if line | |
(goto-line line) | |
(progn | |
(linum-mode 1) |
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
#### | |
## 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
<?php | |
class UrlShortener { | |
const API_URL = 'http://api.bitly.com/v3/shorten'; | |
private $_config; | |
function __construct ($config) { | |
$this->_config = $config; | |
} |