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 | |
$matches = array(); | |
$string = ' one two'; | |
$number_of_matches = preg_match('/\s*(.*)/', $string, $matches); | |
print_r($matches); | |
$replacement_awesomeness = preg_replace('/\s/','-', $matches['1']); | |
print $replacement_awesomeness; |
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
/** | |
* Adds an #ajax property recursively to all elements of a form. | |
* | |
* @param array $element | |
* The first element to recursively apply #ajax to. | |
*/ | |
function recursive_ajax(&$element) { | |
if (element_children($element)) { | |
foreach (element_children($element) as $child) { | |
recursive_ajax($element[$child]); |
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
%r _____ __ %n%y ________ .__ %n | |
%r / _ \_/ |_ ____ ____ %n%y \______ \ ____ _____|__| ____ ____ %n | |
%r / /_\ \ __\/ __ \ / \ %n%y | | \_/ __ \ / ___/ |/ ___\ / \ %n | |
%r/ | \ | \ ___/| | \%n%y | ` \ ___/ \___ \| / /_/ | | \%n | |
%r\____|__ /__| \___ |___| /%n%y /_______ /\___ )____ |__\___ /|___| /%n | |
%r \/ \/ \/ %n%y \/ \/ \/ /_____/ \/ %n | |
%w ________ | |
/ _____/______ ____ __ ________ | |
/ \ __\_ __ \/ _ \| | \____ \ | |
\ \_\ \ | \( |_| ) | / |_| ) |
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 g=git | |
alias ga='git add' | |
alias gb='git branch' | |
alias gba='git branch -a' | |
alias gc='git commit -v' | |
alias 'gc!'='git commit -v --amend' | |
alias gca='git commit -v -a' | |
alias 'gca!'='git commit -v -a --amend' | |
alias gcl='git config --list' | |
alias gcm='git checkout master' |
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
INFO global: Vagrant version: 1.2.1 | |
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.2.1/plugins/commands/box/plugin.rb | |
INFO manager: Registered plugin: box command | |
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.2.1/plugins/commands/destroy/plugin.rb | |
INFO manager: Registered plugin: destroy command | |
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.2.1/plugins/commands/halt/plugin.rb | |
INFO manager: Registered plugin: halt command | |
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.2.1/plugins/commands/init/plugin.rb | |
INFO manager: Registered plugin: init command | |
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.2.1/plugins/commands/package/plugin.rb |
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
diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme | |
index a9de8c8..ac71a38 100644 | |
--- a/themes/agnoster.zsh-theme | |
+++ b/themes/agnoster.zsh-theme | |
@@ -63,7 +63,7 @@ prompt_context() { | |
local user=`whoami` | |
if [[ "$user" != "$DEFAULT_USER" || -n "$SSH_CLIENT" ]]; then | |
- prompt_segment black default "%(!.%{%F{yellow}%}.)$user@%m" | |
+ prompt_segment 252 default "%(!.%{%F{yellow}%}.)$user@%m" |
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
var derp = {foo: 3, bar: 3}; | |
var merp= []; | |
console.log(derp); | |
for (var name in derp) { | |
if (derp.hasOwnProperty(name)) { | |
for (var i = 0; i < derp[name]; i++) { | |
merp.push(name); | |
} | |
} |
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
(function() { | |
var WAITFORIT; | |
// style objects for styles bc lazy | |
var divstyles = { | |
'width' : '300px', | |
'height' : '150px', | |
'backgroundColor' : '#fff', | |
'position' : 'fixed', |
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 | |
/** | |
* Callable typehints are only supported in php >= 5.4. | |
* | |
* For PHP 5.3, remove callable typehint, use is_callable($callback) instead. | |
*/ | |
/** | |
* Returns true if the given predicate is true for all elements. | |
*/ |
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
function voff() { | |
DATVM=`VBoxManage list runningvms | awk '{gsub(/"/, "", $1); print $1}'` | |
VBoxManage controlvm $DATVM poweroff | |
} |
OlderNewer