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
$ find /path/to -type d -exec chmod 775 {} \; | |
$ find /path/to -type f -exec chmod 664 {} \; |
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 Assert extends PHPUnit_Framework_Assert | |
{ | |
/** | |
* Alias for PHPUnit's assertions methods | |
* | |
* The key is the alias name, which can be used as a method, and the value is the full name of the (PHPUnit) method | |
* | |
* @var array | |
*/ |
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 Application_Model_Posts | |
{ | |
public function getPosts() | |
{ | |
$posts = new Application_Model_DbTable_Posts(); | |
$select = $posts->select()->order('created_at DESC') | |
->order('id DESC'); | |
return $posts->fetchAll($select); |
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
db.coll.group({ key: {}, initial: {csum: 0}, reduce: function(obj,prev){ prev.csum += obj.field;}}); |
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 i in {0..40} | |
do | |
echo $i | |
head -c 2146435072 /dev/zero > local.$i | |
done |
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 | |
// secure hashing of passwords using bcrypt, needs PHP 5.3+ | |
// see http://codahale.com/how-to-safely-store-a-password/ | |
// salt for bcrypt needs to be 22 base64 characters (but just [./0-9A-Za-z]), see http://php.net/crypt | |
// just an example; please use something more secure/random than sha1(microtime) :) | |
$salt = substr(str_replace('+', '.', base64_encode(sha1(microtime(true), true))), 0, 22); | |
// 2a is the bcrypt algorithm selector, see http://php.net/crypt |
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
# git | |
alias gl='git pull' | |
alias glom='git pull origin master' | |
alias gp='git push' | |
alias gpom='git push origin master' | |
alias gd='git diff' | |
alias gc='git commit -m' | |
alias gca='git commit -a -m' | |
alias gco='git checkout' | |
alias gb='git branch' |
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
PS1='\n${debian_chroot:+($debian_chroot)}\[\e[1;35m\][\u@\h]\[\e[1;37m\]──\[\e[1;32m\][\w]\[\e[1;37m\]──\[\e[1;34m\]$(__git_ps1 "[ %s ]")\[\e[1;37m\]──\[\e[1;30m\](\t)\[\e[1;37m\]\n\[\e[1;35m\]>\[\e[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
#!/bin/sh | |
echo " | |
Cool, let's start. | |
" | |
src=$PWD |
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
kbd { | |
background: none repeat scroll 0 0 #EEEEEE; | |
border-color: #CCCCCC #AAAAAA #888888 #BBBBBB; | |
border-style: solid; | |
border-width: 1px 3px 3px 1px; | |
color: #000000; | |
padding: 2px 4px; | |
white-space: nowrap; | |
font-family: Monaco,"DejaVu Sans Mono",Courier,monospace; | |
} |
OlderNewer