Skip to content

Instantly share code, notes, and snippets.

View marco-martins's full-sized avatar

Marco Martins marco-martins

View GitHub Profile
@marco-martins
marco-martins / $memoize
Created March 3, 2016 10:00 — forked from jspdown/$memoize
Simple "in-function" memoize for AngularJs
;(function (angular) {
'use strict';
angular
.module('ng-utils', [])
.factory('$memoize', memoize);
function memoize() {
return function (target) {
return function () {
@marco-martins
marco-martins / scopes.txt
Created January 27, 2016 14:33 — forked from iambibhas/scopes.txt
Sublime Text 2: Snippet scopes
Here is a list of scopes to use in Sublime Text 2 snippets -
ActionScript: source.actionscript.2
AppleScript: source.applescript
ASP: source.asp
Batch FIle: source.dosbatch
C#: source.cs
C++: source.c++
Clojure: source.clojure
CoffeeScript: source.coffee
@marco-martins
marco-martins / yosemite-subl
Created September 29, 2015 08:34 — forked from jadaradix/yosemite-subl
Fix Sublime's "subl" command on OS X Yosemite.
rm /usr/local/bin/subl;
ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/subl;
@marco-martins
marco-martins / resources.js
Last active August 29, 2015 14:26 — forked from brucecoddington/resources.js
Wrapping $resource with api and data services.
angular.module('app.resources', ['ngResource'])
.factory('api', function ($resource) {
var api = {
defaultConfig : {id: '@id'},
extraMethods: {
'update' : {
method: 'PUT'
}
@marco-martins
marco-martins / touch-tooltip-fix.js
Created June 26, 2012 10:31 — forked from slawekkolodziej/touch-tooltip-fix.js
Highcharts tracker now don't prevent default behavior (like scrolling on touch devices).
Highcharts.Chart.prototype.callbacks.push(function(chart) {
var hasTouch = hasTouch = document.documentElement.ontouchstart !== undefined,
mouseTracker = chart.tracker,
container = chart.container,
mouseMove;
mouseMove = function (e) {
// let the system handle multitouch operations like two finger scroll
// and pinching
if (e && e.touches && e.touches.length > 1) {