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.
@yoodame
yoodame / gist:8357640
Created January 10, 2014 16:37
drupal versions
#!/bin/bash
# Site URI
echo $(drush @uccd.prod status | grep 'Site URI') > uccd.versions
echo -e "\n\n" >> uccd.versions
# Versions
uccd=$(drush @uccd.prod pmi)
echo "$uccd" >> uccd.versions
# Drupal Version
echo -e "\n\n\nExtension : drupal\nProject : drupal\nType : core\nTitle : Drupal\nStatus : enabled" >> uccd.versions

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 = "[email protected]"
[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/
@yoodame
yoodame / build.xml
Last active December 15, 2015 11:39
VIVO outOfMemory Error
<?xml version="1.0"?>
<!--
Copyright (c) 2012, Cornell University
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,