Skip to content

Instantly share code, notes, and snippets.

View jjanvier's full-sized avatar

Julien Janvier jjanvier

View GitHub Profile
@docteurklein
docteurklein / Collaborator.php
Created August 16, 2014 19:55
a phpspec extension to ease usage of Iterators
<?php
namespace PhpSpec\Iterator;
use PhpSpec\Wrapper\Collaborator as Base;
use Prophecy\Prophecy\ObjectProphecy;
use Prophecy\Promise\ReturnPromise;
class Collaborator extends Base
{
@soheilhy
soheilhy / nginxproxy.md
Last active March 22, 2024 08:54
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@nidup
nidup / gist:9485426
Created March 11, 2014 13:18
Download Crowdin translations + create PR
<?php
$app
->get('/crowdin/pull', function (Request $request) use ($app) {
$responses = array();
$config = $app['config']['crowdin']['download'];
$app['crowdin']->api('export')->execute();
if (!is_dir($config['base_dir'])) {
anonymous
anonymous / main.js
Created November 25, 2013 10:17
reload sf2 wdt on ajax request
$(document).ajaxComplete(function(event, XMLHttpRequest){
var token = XMLHttpRequest.getResponseHeader('x-debug-token'),
protocol = window.location.protocol,
hostname = window.location.hostname;
if(token) {
$.get(protocol+'//'+hostname+'/_wdt/'+token, function(data){
@norberttech
norberttech / selenium-travis.yml
Last active December 28, 2015 02:39
Symfony2 Behat Selenium at travis. Remeber to change domain "example.com"
language: php
php:
- 5.3
- 5.4
- 5.5
before_install:
- sudo apt-get update > /dev/null
@jbenet
jbenet / simple-git-branching-model.md
Last active April 9, 2024 03:31
a simple git branching model

a simple git branching model (written in 2013)

This is a very simple git workflow. It (and variants) is in use by many people. I settled on it after using it very effectively at Athena. GitHub does something similar; Zach Holman mentioned it in this talk.

Update: Woah, thanks for all the attention. Didn't expect this simple rant to get popular.

@agnoster
agnoster / README.md
Last active April 6, 2024 22:35
My ZSH Theme

agnoster.zsh-theme

A ZSH theme optimized for people who use:

  • Solarized
  • Git
  • Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)

For Mac users, I highly recommend iTerm 2 + Solarized Dark

@potix2
potix2 / gist:3339485
Created August 13, 2012 11:01
ApacheBenchでJSONをPOSTする
% ab -n 10 -c 10 -p json.file -T "application/json; charset=utf-8" http://localhost/
@jexchan
jexchan / multiple_ssh_setting.md
Created April 10, 2012 15:00
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@ziadoz
ziadoz / awesome-php.md
Last active April 17, 2024 21:06
Awesome PHP — A curated list of amazingly awesome PHP libraries, resources and shiny things.