Skip to content

Instantly share code, notes, and snippets.

View tiagofernandez's full-sized avatar
☠️

Tiago Fernandez tiagofernandez

☠️
View GitHub Profile
@tiagofernandez
tiagofernandez / ish-bookmarklet.js
Last active April 9, 2016 21:02 — forked from mremco/ish-bookmarklet.js
Bookmarklet that opens the current page into Brad Frost's ish viewport resizing tool (http://bradfrostweb.com/demo/ish/).
javascript:(function(){window.open('http://bradfrostweb.com/demo/ish/?url='+encodeURIComponent(document.URL));})();
@tiagofernandez
tiagofernandez / _jquery-auth-token-django.js
Last active December 20, 2015 22:19 — forked from justinperkins/jquery-auth-token.js
Put auth-token on all jQuery Ajax requests.
$(function() {
$.ajaxSetup({
headers: { 'X-CSRFToken': $('[name="csrfmiddlewaretoken"]').val() }
});
});
@tiagofernandez
tiagofernandez / _.objMapFunctions.js
Last active December 20, 2015 22:19 — forked from eethann/_.objMapFunctions.js
Underscore mixins for Object-based operations.
_.mixin({
// _.map for objects, keeps key/value associations
mapObj: function (input, mapper, context) {
return _.reduce(input, function (obj, v, k) {
obj[k] = mapper.call(context, v, k, input);
return obj;
}, {}, context);
},
#!/usr/bin/env ruby
require 'xmlsimple'
require 'active_support/inflector'
require 'yaml'
require 'json'
require 'fileutils'
require 'date'
class Post