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 / 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) {
@marco-martins
marco-martins / jquery.transliterate.coffee
Created April 4, 2014 09:39
Plugin that will replace diacritic characters with the closest-looking characters
# File: jquery.transliterate.coffee
# Author: Marco Martins | https://github.com/skarface
# Version: 1.0
# Info:
# Prototype based on Backbone.Paginator plugin that will replace diacritic characters with the closest-looking characters
# Credits: https://github.com/backbone-paginator/backbone.paginator/blob/master/plugins/diacritic.js
#
# Usage: String.transliterate()
# e.g 'Jérôme'.transliterate() => Jerome
@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 / 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 / user.sublime-settings
Last active November 6, 2017 16:12
Sublime Settings
{
"color_scheme": "Packages/User/Sunburst.tmTheme",
"draw_white_space": "all",
"ensure_newline_at_eof_on_save": true,
"font_size": 14.5,
//"font_face": "Fira Code",
// "font_options": [
// "gray_antialias"
// ],
"highlight_line": true,
@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 / is-active.js
Created February 9, 2016 15:14
AngularJS is-Active link
'use strict';
/**
* @ngdoc directive
* @name onepmApp.directive:isActive
* @description
* # isActive
*/
angular.module('onepmApp')
.directive('isActive', function ($state, $log, $compile) {
@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 / unsaved-form.js
Last active March 10, 2016 11:49
Angular directive that's fires a confirmation modal on unsaved form (if form touched)
(function () {
'use strict';
/**
* @ngdoc directive
* @name app.directive:unsavedForm
* @description
* Angular directive that's fires a confirmation modal on unsaved form (if form touched)
* @author Marco Martins
* https://gist.github.com/skarface
@marco-martins
marco-martins / user.sublime-keymap
Last active April 22, 2016 18:10
Sublime Keymaps
[
// { "keys": ["super+back_slash"], "command": "toggle_comment", "args": { "block": true } },
{ "keys": ["super+alt+r"], "command": "refresh_folder_list" },
{ "keys": ["super+alt+i"], "command": "reindent", "args": {"single_line": false} },
{ "keys": ["super+alt+a"], "command": "alignment" },
{ "keys": ["super+alt+'"], "command": "change_quotes" },
{ "keys": ["super+back_slash"], "command": "toggle_comment", "args": { "block": false } },
{ "keys": ["super+shift+back_slash"], "command": "toggle_comment", "args": { "block": true } }
]