Skip to content

Instantly share code, notes, and snippets.

View chalasr's full-sized avatar

Robin Chalas chalasr

View GitHub Profile
@chalasr
chalasr / ExampleRepository.php
Created January 13, 2016 18:06 — forked from gnugat/ExampleRepository.php
Declaring a Doctrine Repository as a service and injecting it a dependency.
<?php
namespace Acme\DemoBundle\Repository;
use Acme\DemoBundle\Dependency;
use Doctrine\ORM\EntityRepository;
/**
* Get this repository directly from the container: it will set the $dependency attribute.
* If you get it using Doctrine's "getRepository()", don't forget to call setDependency().
@chalasr
chalasr / angularjs-interceptor.js
Created January 4, 2016 12:15 — forked from gnomeontherun/angularjs-interceptor.js
Intercept XHR/Ajax requests with AngularJS http interceptors. This allows you to globally intercept and modify requests and responses. You don't need to declare all of the methods, just the ones you need. Some example uses would be logging errors, adding extra headers, or triggering 'loading' screens. This intercepts ALL requests/responses, so y…
// Intercepting HTTP calls with AngularJS.
angular.module('MyApp', [])
.config(function ($provide, $httpProvider) {
// Intercept http calls.
$provide.factory('MyHttpInterceptor', function ($q) {
return {
// On request success
request: function (config) {
// console.log(config); // Contains the data about the request before it is sent.
@chalasr
chalasr / jekyll_gist_tag.rb
Last active April 8, 2021 10:45 — forked from imathis/gist_tag.rb
Embed gists in markdown files of a jekyll application by creating a custom Liquid tag
require 'cgi'
require 'digest/md5'
require 'net/https'
require 'uri'
module Jekyll
class GistTag < Liquid::Tag
def initialize(tag_name, text, token)
super
@text = text
@chalasr
chalasr / simple-git-branching-model.md
Last active October 14, 2024 23:00 — forked from jbenet/simple-git-branching-model.md
a simple git branching model

a simple git branching model

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.