Skip to content

Instantly share code, notes, and snippets.

View ubermuda's full-sized avatar

Geoffrey Bachelet ubermuda

  • Paper Edu.
  • Granby, QC
View GitHub Profile
{
"name": "foo/bar",
"repositories": [
{ "type": "vcs", "url": "https://github.com/ubermuda/MonologBridge" }
],
"require": {
"phpunit/phpunit": "3.7.*",
"pimple/pimple": "1.0.2",
"symfony/console": "2.3.*",
"symfony/finder": "2.3.*",
module M
MACHINCHOSE="prout"
end
require './vagrant.local'
puts M::MACHINCHOSE
set nocompatible
filetype off
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
Bundle 'gmarik/vundle'
Bundle 'scrooloose/nerdtree'
Bundle 'ctrlp.vim'
Bundle 'Lokaltog/vim-powerline'
@ubermuda
ubermuda / sf-permissions.bash
Created January 8, 2013 21:15
sets permissions on a symfony's cache and logs directories for both your user and the apache/httpd user
#!/bin/bash
function detect_apache_user {
ps axho user,comm | grep -E "apache|httpd" | grep -v root | uniq | awk 'END { print $1 }'
}
APACHE_USER=$( detect_apache_user )
USER=$( whoami )
echo "Allowing apache user '$APACHE_USER' and user '$USER'"
<?php
// note: `FoobarType` has a `data_class` option set to `Foobar`
$builder
->add('Foobars', 'collection', [
'type' => new FoobarType(new Foobar()) // does not seem to work :/
])
;
@ubermuda
ubermuda / robot.js
Created December 3, 2012 18:32
W00t #1 YEAH!!!! (Zolmesiter)
var Robot = function(robot){
robot.turnLeft(robot.angle % 90);
//robot.turnGunRight(90);
robot.clone();
this.direction = 1;
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.ahead(1);
if (robot.parentId) {
<?php
$app->match('/link', function() use ($app) {
return new Response('', 200);
})->method('OPTIONS');
ash:~$ php -r 'var_dump(json_encode([1 => "foo"]));'
string(11) "{"1":"foo"}"
ash:~$ php -r 'var_dump(json_encode([0 => "foo"]));'
string(7) "["foo"]"
Problem 1
- Installation request for twig/twig == 1.10.9999999.9999999-dev -> satisfiable by twig/twig 1.10.x-dev.
- Can only install one of: twig/twig 1.10.x-dev, twig/twig 1.9.x-dev.
- Installation request for twig/twig == 1.9.9999999.9999999-dev -> satisfiable by twig/twig 1.9.x-dev.
@ubermuda
ubermuda / consume.bash
Created October 7, 2012 20:22
A quick redis consumer in bash (using a custom silex console in this case, but you get the point)
#!/bin/bash
POP_FROM="jobs"
PUSH_TO="jobs_running"
REDIS_CLI=$(which redis-cli)
CONSOLE_DIR=$(cd $(dirname "$0"); pwd)/..;
while job=$($REDIS_CLI brpoplpush $POP_FROM $PUSH_TO 0); do
eval $(echo $CONSOLE_DIR/console $job);