This file contains hidden or 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 www@localhost | |
ServerName auto.local | |
ServerAlias *.local | |
ServerAlias *.*.local | |
UseCanonicalName Off | |
VirtualDocumentRoot /var/www/%-2/htdocs | |
ErrorLog "/var/log/apache2/auto-error_log" |
This file contains hidden or 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 | |
# List all installed brew formulas not used by other installed formulas. | |
# Useful for cleanup | |
for f in `brew list`; do | |
[[ -z "$(brew uses --installed $f)" ]] && echo $f | |
done |
This file contains hidden or 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 CodeGenerator | |
{ | |
private static $alphabet = '23456789abcdefghijkmnpqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ'; | |
private static $max_offset = 55; | |
/** | |
* Generate a random character of non-ambiguous number or letter. | |
* @return string the character |
This file contains hidden or 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(d,s){ | |
var n,b=d.getElementsByTagName(s)[0]; | |
function l(u){ | |
n=d.createElement(s); | |
n.src=u; | |
b.parentNode.insertBefore(n,b); | |
} | |
l("//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"); | |
l("//gist.github.com/raw/3409527/converter.js"); | |
})(document, "script"); |
This file contains hidden or 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 | |
namespace Acme\SiteBundle\Listener; | |
use Doctrine\ORM\Event\LifecycleEventArgs; | |
use Acme\SiteBundle\Entity\Comment; | |
use Symfony\Component\DependencyInjection\ContainerInterface; | |
use Symfony\Component\Security\Acl\Domain\ObjectIdentity; | |
use Symfony\Component\Security\Acl\Domain\UserSecurityIdentity; |
This file contains hidden or 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 | |
# Usage: osx-battery-status.sh [width of progress bar] | |
# If specified, will use $width characters to display a progress bar, padding with spaces | |
# Uses half block when needed | |
ioreg="`ioreg -c AppleSmartBattery`" | |
current=`echo "$ioreg" | grep CurrentCapacity | grep -oE "[0-9]+"` | |
max=`echo "$ioreg" | grep MaxCapacity | grep -oE "[0-9]+"` | |
battery=$(( $current * 100 / $max )) |
This file contains hidden or 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
# Make it use C-a, similar to screen.. | |
bind-key C-a last-window | |
bind-key a send-prefix | |
set -g prefix C-a | |
# Reload key | |
bind r source-file ~/.tmux.conf | |
set -g history-limit 1000 |
This file contains hidden or 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 | |
namespace Acme\CommonBundle\DependencyInjection; | |
use Symfony\Component\DependencyInjection\ContainerBuilder; | |
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; | |
use Symfony\Component\DependencyInjection\Reference; | |
class DoctrineEntityCompilerPass implements CompilerPassInterface | |
{ |
This file contains hidden or 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 | |
// Commons | |
$callable = function() {}; | |
function empty_function() {}; | |
class A { | |
public static function empty_function() {} | |
public function empty_method () {} | |
} |
This file contains hidden or 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 | |
# Generates a random password using only non-ambiguous alphanumeric characters | |
# Usage: genpasswd.sh [length] | |
length=16 | |
if [[ -n "$1" ]]; then | |
length="$1" | |
fi |