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 | |
/** | |
* The render function is a lightweight template engine, that allows string | |
* interpolation and output escaping. | |
* | |
* ...and it fits in a tweet. | |
* | |
* @author Quentin Schuler aka Sukei <qschuler@neosyne.com> | |
*/ |
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 | |
/** | |
* The Signal class is the smallest and fastest observer written in PHP 5.6 and | |
* using some new features such as the variadic functions and the arguments | |
* unpacking. | |
* | |
* ...and it fits in a tweet. | |
* | |
* @author Quentin Schuler aka Sukei <qschuler@neosyne.com> |
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
<script> | |
// in the html page | |
angular.module('config', []).constant('APIKEY',''5250738f97ce29c219000011''); | |
</script> | |
myApp.controller('JobsCtrl', ['$scope', 'Jobs', 'APIKEY', function($scope, Jobs, apiKey) { | |
var promise = Jobs(apiKey).query().$promise; | |
// do more awesome programming | |
} |
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
#!/usr/bin/env bash | |
# finds all sprint tags (like @sprint:42) and runs them in a reversed order (won't run not tagged scenarios) | |
PARALLEL_COMMAND='parallel --gnu' | |
#PARALLEL_COMMAND='xargs -I{}' | |
BEHAT_COMMAND='./bin/behat --ansi --tags={}' | |
grep '@sprint:' features/*.feature | sed -e 's/.*\(@sprint:[0-9]*\).*/\1/' | sort -ur | $PARALLEL_COMMAND $BEHAT_COMMAND |
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-doc.el --- doc block generator/extractor for php | |
;; Copyright (C) 2010, 2013 Stefan Siegl <stesie@brokenpipe.de> | |
;; Maintainer: Stefan Siegl <stesie@brokenpipe.de> | |
;; Author: Stefan Siegl <stesie@brokenpipe.de> | |
;; Keywords: php docblock | |
;; Created: 2010 | |
;; Modified: 2013-09-14 | |
;; X-URL: https://gist.github.com/stesie |
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 | |
namespace Acme\DemoBundle\Controller; | |
use Symfony\Component\HttpFoundation\Request; | |
use Symfony\Bundle\FrameworkBundle\Controller\Controller; | |
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method; | |
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; | |
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; | |
use Acme\DemoBundle\Entity\Book; |
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
// Just before switching jobs: | |
// Add one of these. | |
// Preferably into the same commit where you do a large merge. | |
// | |
// This started as a tweet with a joke of "C++ pro-tip: #define private public", | |
// and then it quickly escalated into more and more evil suggestions. | |
// I've tried to capture interesting suggestions here. | |
// | |
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_, | |
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant, |
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
package main | |
import ( | |
"fmt" | |
"reflect" | |
) | |
type Foo struct { | |
FirstName string `tag_name:"tag 1"` | |
LastName string `tag_name:"tag 2"` |
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
package main | |
import ( | |
eventsource "github.com/antage/eventsource/http" | |
redis "github.com/vmihailenco/redis" | |
"log" | |
"net/http" | |
) | |
func haltOnErr(err error){ |
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 | |
namespace Vandpibe\PHPSpec\Extension; | |
use PHPSpec2\ServiceContainer; | |
use PHP_CodeCoverage; | |
use PHP_CodeCoverage_Report_HTML; | |
class CodeCoverage implements \PHPSpec2\Extension\ExtensionInterface | |
{ |