Skip to content

Instantly share code, notes, and snippets.

View andremedeiros's full-sized avatar
:shipit:

André Medeiros andremedeiros

:shipit:
View GitHub Profile
(function ( jQuery ) {
$( 'body' ).delegate( ".ui-page", "pagebeforeshow", function( event, opts ) {
var $page = $(event.target),
reloadPage = false,
cacheStrategy = $page.data('cache'),
pageInstance = $page.data('page'),
invalidateCache = pageInstance.dirtyCache;
// Check if page never gets cached
if ( cacheStrategy == 'never' ) {
@andremedeiros
andremedeiros / jquery.mobile.page.cache.js
Created November 17, 2010 18:58
jquery.mobile.page.cache.js
(function ( $ ) {
var rscript = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi;
$.mobile.page.prototype.options.cache = true;
$( "body" )
.delegate( ":mobile-page", "pagebeforecreate", function() {
var page = $( this ).data( "page" ),
cache = page.options.cache;
if ( cache === true ) {
return;
# Helpers
def get_file(http_location, file)
run "curl -sL #{http_location}/#{file} > #{file}"
end
def app_name
@app_name ||= @root.split('/').last
end
# Remove Prototype defaults and grab jQuery + Rails adapter
@andremedeiros
andremedeiros / LICENSE.txt
Created May 17, 2011 10:42 — forked from jed/LICENSE.txt
route client urls with 404s and pattern captures
Copyright (c) 2011 Jed Schmidt, http://jed.is
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
/*
Licensed under the MIT License
Copyright (c) 2011 Cédric Luthi
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@andremedeiros
andremedeiros / .gitignore
Created June 13, 2011 14:26
Xcode4 gitignore
.DS_Store
*.swp
*~.nib
build/
*.pbxuser
*.perspective
*.perspectivev3
@andremedeiros
andremedeiros / retry_upto.rb
Created October 7, 2011 08:41 — forked from raul/retry_upto.rb
retry_upto.rb
# Ruby's `retry` with steroids:
#
# - retry up to 5 times without waiting between them and retrying after any exception
#
# retry_upto(5) do ... end
#
# - retry up to 5 times, waiting 2 seconds between retries and retrying after any exception
#
# retry_upto(5, :wait => 2) do ... end
#
@andremedeiros
andremedeiros / BaseViewController.m
Created October 17, 2011 10:25 — forked from boctor/BaseViewController.m
A base view controller class that when running on the simulator in debug mode, will auto simulate a memory warning every time the view controller's viewDidAppear is called
//
// BaseViewController.m
//
// Created by Peter Boctor on 5/4/11.
//
// Copyright (c) 2011 Peter Boctor
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
@andremedeiros
andremedeiros / Makefile
Created October 18, 2012 12:33
Makefile for a Typescript project
all: compile test
deps:
if ! test -d node_modules; then npm install; fi
clean:
rm -rf lib/*
TMP_FILE := $(shell mktemp -t project_name)
compile: deps clean

Keybase proof

I hereby claim:

  • I am andremedeiros on github.
  • I am andremedeiros (https://keybase.io/andremedeiros) on keybase.
  • I have a public key whose fingerprint is 69DD D1E4 06BE C8B7 A183 3387 E7C8 3C56 BC29 F743

To claim this, I am signing this object: