Skip to content

Instantly share code, notes, and snippets.

@alOneh
alOneh / gist:1433101
Created December 5, 2011 10:09
Change the local timezone to UTC on unix
sudo rm /etc/localtime
sudo ln -s /usr/share/zoneinfo/UTC /etc/localtime
# now check it's ok
$ date
lun déc 5 10:03:47 UTC 2011
@everzet
everzet / watch.rb
Created April 11, 2012 13:31
https://github.com/mynyml/watchr script to continuously run Behat and PHPUnit test suites on classes/features that have been modified.
watch( '(src/.*\.feature)$' ) {|md| system("./console -e=test behat -fprogress #{md[1]}") }
watch( '(src/.*\.php)$' ) {|md| system("phpunit -c app src") }
@havvg
havvg / config_dev.yml
Created July 24, 2012 09:52
optionally import Symfony2 configuration
imports:
- { resource: parameters_dev.yml }
- { resource: config.yml }
- { resource: config_local.yml, ignore_errors: true }
framework:
profiler:
only_exceptions: false
web_profiler:
<?php
require_once __DIR__.'/autoload.php.dist';
use Symfony\Component\ExpressionLanguage\ExpressionLanguage;
use Symfony\Component\Routing\Matcher\UrlMatcher;
use Symfony\Component\Routing\Matcher\RequestMatcherInterface;
use Symfony\Component\Routing\RequestContext;
use Symfony\Component\Routing\RouteCollection;
use Symfony\Component\Routing\Route;

Docker PostgreSQL How-To

How to use [zaiste/postgresql][1] Docker container.

Docker >= 0.5.0 required.

docker pull zaiste/postgresql
@callado4
callado4 / behat-phantomjs-webdriver.md
Last active January 24, 2021 17:10
Instructions on how to make behat (with mink) use the phantomjs webdriver to run headless browser tests

Making behat use phantomjs for the tests

If you want to run it on phantomjs (a headless browser) you can add this profile to your behat.yml and you need phantomjs >= 1.8.0

phantomjs:
    extensions:
        Behat\MinkExtension\Extension:
            base_url: http://dev.local
            goutte: ~
            selenium2:
 wd_host: "http://localhost:8643/wd/hub" 
#!/usr/bin/env osascript -l JavaScript
ObjC.import("Cocoa");
function run(argv) {
var app = $.NSApplication.sharedApplication;
var statusBarItem = $.NSStatusBar.systemStatusBar.statusItemWithLength($.NSVariableStatusItemLength);
var track = Application('Spotify').currentTrack
ObjC.registerSubclass({
name: "ProgramDelegate",
@merk
merk / AbstractInvoiceLineType.php
Created July 6, 2012 06:07
Symfony2 Form Polycollection for use with objects in an inheritance structure
<?php
// ...
class AbstractInvoiceLineType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
// ...
@stefano-bortolotti
stefano-bortolotti / README.md
Last active May 6, 2022 10:56
iOS App Rating widget for Dashing

##Preview

Description

Display your iOS App Rating info. It uses iTunes Store website as the source.

##Usage

@xanf
xanf / AjaxAuthenticationListener.php
Created June 8, 2011 19:20
AJAX auth errors listener for Symfony2
<?php
namespace Application\ProdrepHelperBundle\Component\Event;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Security\Core\Exception\AuthenticationException;
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent;
/**
*/
class AjaxAuthenticationListener