Skip to content

Instantly share code, notes, and snippets.

// 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.

Example ~/.gitconfig is given below. In it, I define a simple alias that will print a nice log graph, "logtree". "logtree" is invoked from the commandline as "git logtree". Arguments are passed, so I can do "git logtree --oneline" and get the expected result.

[user]
    name = "Stephen Rosen"
    email = "sirosen@uchicago.edu"
[alias]
    logtree = "log --graph --decorate --all"
[push]
<?php
/**
* Github WebHook processor
* POST to: postreceive.php?key=REPLACE_ME_WITH_A_UNIQUE_KEY
*
* @author Luis Abreu
* @version 0.1
* @copyright Quodis, 24 February, 2011
* @package default

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/