Skip to content

Instantly share code, notes, and snippets.


Jose Martinez callado4

  • New York, NY
View GitHub Profile
View angularjs-interceptor.js
// 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.
View Class.js
/* Simple JavaScript Inheritance for ES 5.1 ( includes polyfill for IE < 9 )
* based on
* (inspired by base2 and Prototype)
* MIT Licensed.
(function (global) {
"use strict";
if (!Object.create) {
Object.create = (function () {
View gist:5909843

Sublime Text 2 – Useful Shortcuts (Mac OS X)


⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
View autossh init.d
#! /bin/sh
# autossh init.d This script starts and stops an autossh daemon
# chkconfig: 2345 95 15
# processname: autossh
# Original Author: Andreas Olsson <>
# Version: @(#) 0.1 27-Aug-2008
callado4 /
Created Apr 16, 2013
CodeIgnitor/PHP mssql with freetds and Homebrew

Make sure you installed Hombrew PHP with --with-mssql

You can check using a command like below: /usr/local/opt/php53/bin/php -i | grep Configure

When I pointed my apache to the homebrew version of php, it was already configured to have the mssql and freetds libraries working, otherwise you may have to add the .so file in the freetds directory to your php.ini file

Then I just had to something like this to my freetds.conf:

callado4 /
Created Mar 18, 2013
Javascript design patterns

JavaScript best practices

Collection of links from HN submission:

Some have commented that the [linked article][1] may not always contain best practices. The following links always seem to get fantastic praise - they're permanently in my JS bookmarks. Having an understanding of the core language rather than using frameworks is a great start; these articles will certainly help.

View cdn.txt
Following the down-time of Godaddy, you will now have to update the previous URLs.
It is much more safer to link to the raw CDN URL.
callado4 /
Last active Apr 17, 2018
Instructions on how to make behat (with mink) use the phantomjs webdriver to run headless browser tests

Making behat use phantomjs for the tests

If you want to run it on phantomjs (a headless browser) you can add this profile to your behat.yml and you need phantomjs >= 1.8.0

            base_url: http://dev.local
            goutte: ~
                wd_host: "http://localhost:8643/wd/hub" 
callado4 / .bash_login.jenkins
Created Sep 7, 2012 — forked from fancyremarker/.bash_login.jenkins
[ClearServe] Scripts related to Jenkins client setup
View .bash_login.jenkins
# if running bash
if [ -n "$BASH_VERSION" ]; then
# include .bashrc if it exists
if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
You can’t perform that action at this time.