Skip to content

Instantly share code, notes, and snippets.

View carloslopes's full-sized avatar

Carlos Eduardo L. Lopes carloslopes

View GitHub Profile
@carloslopes
carloslopes / gist:7354100
Last active December 27, 2015 16:19 — forked from ericboehs/gist:7125105
Workaround for CoreText performance notes when using phantomjs on OS X Mavericks
module Capybara::Poltergeist
class Client
private
def redirect_stdout
prev = STDOUT.dup
prev.autoclose = false
$stdout = @write_io
STDOUT.reopen(@write_io)
prev = STDERR.dup
@carloslopes
carloslopes / gist:6306255
Last active September 3, 2017 09:44 — forked from joost/ruby_google_analytics_server_to_server.md
Google Analytics API (server-to-server) using Ruby
require 'sinatra/base'
module Sinatra
module FragmentCache
def fragment_cache(name, age, &block)
if cache = read_fragment(name, age)
@_out_buf << cache
else
pos = @_out_buf.length
tmp = block.call
@carloslopes
carloslopes / ajaxify-html5.js
Created August 28, 2012 14:36 — forked from balupton/README.md
Ajaxify a Website with the HTML5 History API using History.js, jQuery and ScrollTo
// https://gist.github.com/854622
(function(window,undefined){
// Prepare our Variables
var
History = window.History,
$ = window.jQuery,
document = window.document;
// Check to see if History.js is enabled for our Browser