Skip to content

Instantly share code, notes, and snippets.

View pthiers's full-sized avatar

Philippe Thiers pthiers

  • RiskAmerica SPA
  • Puerto Octay, Chile
  • 14:47 (UTC -04:00)
View GitHub Profile
@dshaw
dshaw / gist:378192
Created April 25, 2010 05:56 — forked from paulirish/gist:315916
(function(window,document,undefined){ ... })(this,this.document);
// everyone's new favorite closure pattern:
(function(window,document,undefined){ ... })(this,this.document);
// when minified:
(function(w,d,u){ ... })(this,this.document);
// which means all uses of window/document/undefined inside the closure
// will be single-lettered, so big gains in minification.
// it also will speed up scope chain traversal a tiny tiny little bit.
@jelcaf
jelcaf / Operaciones-Git
Last active May 15, 2024 15:31
Git Tips - Mini-trucos de Git para facilitarme la tarea
#############################################
# Push de la rama actual
git push origin $rama_actual
#############################################
# Volver a un commit anterior, descartando los cambios
git reset --HARD $SHA1
#############################################
# Ver y descargar Ramas remotas
@Calvein
Calvein / Custom.css
Created March 23, 2012 20:24
Solarized Dark Skin for the Chrome DevTools
body#-webkit-web-inspector #main{background-color:#002b36!important}body#-webkit-web-inspector #main .panel.network,body#-webkit-web-inspector #main .panel.timeline,body#-webkit-web-inspector #main .panel.profiles,body#-webkit-web-inspector #main .panel.audits,body#-webkit-web-inspector #main .panel.extension{background-color:#fff!important}body#-webkit-web-inspector #console-messages a:hover,body#-webkit-web-inspector #console-messages .console-formatted-function,body#-webkit-web-inspector #console-messages .console-formatted-object{color:#93a1a1!important}body#-webkit-web-inspector #console-prompt,body#-webkit-web-inspector #console-messages a,body#-webkit-web-inspector #console-messages .console-message,body#-webkit-web-inspector #console-messages .console-group-messages .section .header .title{color:#839496!important}body#-webkit-web-inspector #console-messages .console-formatted-null,body#-webkit-web-inspector #console-messages .console-formatted-undefined{color:#657b83!important}body#-webkit-web-inspect
@liamcurry
liamcurry / gist:2597326
Created May 4, 2012 19:56
Vanilla JS vs jQuery

Moving from jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
@nijikokun
nijikokun / nuid.js
Created June 24, 2012 21:09
Client / Node supported fast UUID script.
// NUUID - Nijiko's Universal? Unique Identifier
// http://twitter.com/nijikokun - (c) a: Nijikokun l: AOL y: 2012
//
// It's been tested against uuid and is universally faster with zero collisions thus far.
// No RFC or SPEC, Simple unique id with secret key support, not dependent on an internal "clock"
//
// Made it even more performant.
//
// Test with collision detection:
// http://jsfiddle.net/HX3nL/3/
@brandonb927
brandonb927 / osx-for-hackers.sh
Last active July 24, 2024 15:28
OSX for Hackers: Yosemite/El Capitan Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned.
#!/bin/sh
###
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer)
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos
###
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx
@baamenabar
baamenabar / PagoWebPay.php
Created August 7, 2012 21:53
Clase de pago de webpay
<?php
/*
Class PagoWebPay
Versión: 0.1
Autor: Agustín Amenabar, @baamenabar (es) @ImINaBAR (en)
Licencia: MIT
parámetros:
$rdb: instancia de un objeto PDO ya inicializado, en su defecto, la clase se conectará sola, si es que se entregan los datos de conexión en el parámetro $configuracionClase.
$carpetaCGI : Dirección de carpeta CGI de transbank. Es importante dar la dirección correcta en cada instanciación, a veces uno tiene scripts en diferentes direcciones relativas con respecto a la carpeta CGI.
@navasvarela
navasvarela / .htaccess
Created September 6, 2012 09:05
Sinatra setup in bluehost
AddHandler fcgid-script .fcgi
AddHandler cgi-script .cgi
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
@zhouming
zhouming / MY_Session.php
Created September 8, 2012 05:51
Use redis in Codeigniter Session.
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class MY_Session extends CI_Session{
private $sess_use_redis = TRUE;
private $redis = '';
public function __construct($params = array()) {
//parent::__construct();
$this->CI =& get_instance();
@zziuni
zziuni / stuns
Created September 18, 2012 08:05
STUN server list
# source : http://code.google.com/p/natvpn/source/browse/trunk/stun_server_list
# A list of available STUN server.
stun.l.google.com:19302
stun1.l.google.com:19302
stun2.l.google.com:19302
stun3.l.google.com:19302
stun4.l.google.com:19302
stun01.sipphone.com
stun.ekiga.net