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
/** | |
* Convert a decimal to a fraction. | |
* | |
* @param number $decimal | |
* @return string | |
*/ | |
public static function decimal2fraction($decimal) | |
{ | |
$decimalBase = --$decimal; | |
$denomenator = 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
/** | |
* Convert a fractinal price to a decimal price. | |
* | |
* @param string $fractional | |
* @return string | |
*/ | |
public static function fractional2decimal($fractional) | |
{ | |
list ($numerator, $denomenator) = explode('/', $fractional); | |
return number_format(($numerator / $denomenator) + 1, 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
$wd = $this->getSession()->getDriver()->getWebDriverSession(); | |
$wd->window($wd->window_handle())->maximize(); |
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 | |
/** | |
* Regex.php | |
* | |
* Simple mapping class for frequently used regular expressions. | |
* | |
* @author James Morgan <[email protected]> | |
*/ | |
final class Regex |
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
Show hidden characters
{ | |
"always_show_minimap_viewport": true, | |
"bold_folder_labels": true, | |
"caret_style": "phase", | |
"font_size": 12, | |
"highlight_line": true, | |
"highlight_modified_tabs": true, | |
"ignored_packages": [], | |
"margin": 0, | |
"rulers": |
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
<VirtualHost *:80> | |
ServerAdmin [email protected] | |
ServerName jenkins.localhost | |
ProxyRequests Off | |
<Proxy *> | |
Order deny,allow | |
Allow from all | |
</Proxy> | |
ProxyPreserveHost on |
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
# IP alias | |
alias ip="ifconfig | grep 'inet addr:172' | awk {'print \$2'} | awk -F':' {'print \$2'}" | |
# Command prompt | |
source ~/.git-prompt.sh | |
export PS1='\[\033[01;35m\]$(date +%k:%M:%S)\[\033[00m\] \[\033[01;36m\]$(whoami)\[\033[00m\]\[\033[01;31m\]@\[\033[00m\]\[\033[01;33m\]$(hostname)\[\033[00m\] \[\033[01;32m\]\w\[\033[01;31m\]$(__git_ps1)\[\033[00m\] → ' | |
# Directory size | |
alias dirsize="du -h | tail -1 | awk '{print \$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
AlignTab.sublime-package | |
AmpScript Highlighter.sublime-package | |
Apache Hive.sublime-package | |
Behat.sublime-package | |
BlameHighlighter.sublime-package | |
BracketHighlighter.sublime-package | |
Emmet.sublime-package | |
DocBlockr.sublime-package | |
GitGutter.sublime-package | |
Highlighter.sublime-package |
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
[user] | |
name = James Morgan | |
email = [email protected] | |
[alias] | |
ci = commit | |
st = status -sb | |
co = checkout | |
di = diff | |
dis = diff --staged |
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
/** | |
* Mimics PHP's ucfirst function. | |
* | |
* @param subject The string to be ucfirst'd | |
* @return The subject string with an uppercased first character | |
*/ | |
final public static String ucfirst(String subject) | |
{ | |
return Character.toUpperCase(subject.charAt(0)) + subject.substring(1); | |
} |
OlderNewer