Skip to content

Instantly share code, notes, and snippets.

View leite's full-sized avatar
🎉
it is happening

Francisco Leite leite

🎉
it is happening
View GitHub Profile
@leite
leite / loadYoutubeVideos.js
Created December 23, 2011 20:11
[JQuery Plugin] load a list of videos from youtube
/*
* JQuery Videos Loader
* @xxleite ( 23/12/2011 17:45:00 -3 UTC )
*
* parameters:
* user = youtube username
* maxVideos = total of videos to load
* onSuccess = function callback to receive videos array
*
*/
@leite
leite / foo.js
Created July 3, 2012 19:12
parse json
function foo() {
var json = '{"response":"","content":{"users":[{"name":"victor","age":"24"},{"name":"isabella","age":"22"},{"name":"maria","age":"12"}' +
',{"name":"raquel","age":"13"},{"name":"paulo","age":"22"},{"name":"isabella","age":"25"}]}}';
var data;
var res = json.match( /{"([^"]+)":"([^"]+)","([^"]+)":"([^"]+)"}/g );
for( i=0;i<res.length;i++ ) {
@leite
leite / gist:3520137
Last active October 9, 2015 14:08
php compilation
sudo ./configure --enable-bcmath --enable-calendar --enable-exif --enable-ftp --enable-gd-native-ttf --enable-mbstring --enable-shmop --enable-sockets --enable-sysvsem --enable-sysvshm --enable-tokenizer --enable-wddx --with-openssl --with-zlib-dir --with-zlib --with-bz2 --with-jpeg-dir --with-curl --with-gd --with-png-dir --with-xpm-dir --with-freetype-dir --with-gettext --with-gmp=/usr/include --with-mcrypt=/usr/local/libmcrypt --with-mhash --with-mysql --with-pspell --with-regex=php --with-xmlrpc --with-iconv --with-tsrm-st --with-tsrm-pthreads --with-kerberos --enable-soap --with-pdo-mysql --with-mysqli --with-libxml --with-xsl --with-config-file-scan-dir=/usr/lib/php5 --with-config-file-path=/usr/lib/php5/php.ini
@leite
leite / gist:3678525
Created September 8, 2012 18:46
domain resolver service, a very simple, fast, low heap Lua script ... i wrote this to use together with gnutella2 cache/torrent tracker who lives in google appengine and doesnt have Inet class :(
--[[
----------------------------------------------------------------------------
"THE BEER-WARE LICENSE" (Revision 42):
<xxleite@gmail.com> wrote this file. As long as you retain this notice you
can do whatever you want with this stuff. If we meet some day, and you think
this stuff is worth it, you can buy me a beer in return
----------------------------------------------------------------------------
--]]
-- all necessery libs
@leite
leite / gist:4189368
Created December 2, 2012 15:39
Install wkhtmltopdf step by step in debian based linux
sudo apt-get install openssl build-essential xorg libssl-dev libxrender-dev libqt4-dev qt4-dev-tools
wget http://wkhtmltopdf.googlecode.com/files/wkhtmltopdf-0.11.0_rc1.tar.bz2
tar xjf wkhtmltopdf-0.11.0_rc1.tar.bz2
cd wkhtmltopdf-0.11.0_rc1
make
sudo make install
@leite
leite / gist:4989353
Created February 19, 2013 20:02
index no more!
server {
location /index {
rewrite ^/index / permanent;
}
}
@leite
leite / gist:5039296
Created February 26, 2013 15:28
example php with db connection
<?php
class usuario{
//variaveis privadas
private $_codCliente;
private $_nome;
private $_email;
private $_endereco;
private $_numero;
@leite
leite / gist:5569029
Last active December 17, 2015 06:58
jetty one run installer
#! /bin/bash
JETTY_BIN_URL=http://eclipse.c3sl.ufpr.br/jetty/8.1.9.v20130131/dist/jetty-distribution-8.1.9.v20130131.tar.gz
JETTY_DIR=/etc/jetty
JETTY_USER=jetty
JETTY_GROUP=www-data
JETTY_PID=/var/run/jetty.pid
JETTY_PORT=8080
JETTY_LOGS=/var/log/jetty
@leite
leite / gist:6063830
Created July 23, 2013 16:25
full diff between two directories
diff -ENwbur --exclude=.git --exclude=.svn thx/ ../dev/arkleite/vendor/plugins/thinking-sphinx/ > thinkingx
@leite
leite / gist:6259269
Created August 18, 2013 00:07
wtf, multidimensional array o chars
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#if !defined mempcpy
void *mempcpy(void *dst, const void *src, size_t len) {
return (char *) memcpy(dst, src, len) + len;
}
#endif