Skip to content

Instantly share code, notes, and snippets.

View arturocr's full-sized avatar

Arturo Campos arturocr

View GitHub Profile

Keybase proof

I hereby claim:

  • I am arturocr on github.
  • I am arturocr (https://keybase.io/arturocr) on keybase.
  • I have a public key whose fingerprint is 1264 4B9D B0D7 419D 7C07 23D6 65A9 765F 5792 BB13

To claim this, I am signing this object:

@arturocr
arturocr / gapps-config.txt
Created September 23, 2015 23:14
Open GApps configuration file (for Stock Package)
AndroidPay
Books
CalendarGoogle
CalSync
CameraGoogle
Docs
Earth
ExchangeGoogle
Fitness
GoogleNow
@arturocr
arturocr / jQuery.textselect.js
Created October 31, 2012 21:16
jQuery Textselect Event Plugin
/* jQuery plugin textselect
* version: 1.0
* tested on jQuery 1.3.2, 1.5
* author: josef.moravec@gmail.com, duane.johnson@gmail.com
*
* usage:
* $(function() {
* $(document).bind('textselect', function(e) {
* Do stuff with e.text
* });
@arturocr
arturocr / HTML5-placeholder-fallback.js
Created August 29, 2012 16:16
HTML5 Placeholder Fallback with jQuery
$(document).ready(function() {
if (!("placeholder" in document.createElement("input"))) {
$("input[placeholder]").each(function() {
var val = $(this).attr("placeholder");
if (this.value == "") {
this.value = val;
}
$(this).focus(function() {
if (this.value == val) {
this.value = "";
@arturocr
arturocr / forceDownload.php
Created May 9, 2012 19:36
Force Download in PHP
<?php
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename=' . basename($file));
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate');
header('Pragma: public');
header('Content-Length: ' . filesize($file));
ob_clean();