Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View mendelgusmao's full-sized avatar
😅
what's up?

Mendelson Gusmão mendelgusmao

😅
what's up?
View GitHub Profile
** Invoke library:build (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute library:build
rake aborted!
undefined method `external_encoding' for #<String:0xa5e559c>
/usr/local/lib/ruby/1.9.1/psych.rb:203:in `parse'
/usr/local/lib/ruby/1.9.1/psych.rb:203:in `parse_stream'
/usr/local/lib/ruby/1.9.1/psych.rb:151:in `parse'
/usr/local/lib/ruby/1.9.1/psych.rb:127:in `load'
/^(?<collection_path>.*(?<collection_name>MP\d))\\(?<genre_name>.*)\\((?<artist_name>.*)(\s\((?<country_name>.{3})\))?)\\(?<album_year>\d{4})\s-\s(?<album_title>.*)\\/
// !OK
"D:\\MP3\\Genre\\Artist (Cty)\\2004 - Album Title\\01 - Song Title.mp3" => {
"collection_path"=>"D:\\MP3",
"collection_name"=>"MP3",
"genre_name"=>"Genre",
"artist_name"=>"Artist (Cty)",
"country_name"=>nil,
"album_year"=>"2004",
@mendelgusmao
mendelgusmao / CHANGELOG.txt
Created July 28, 2012 22:36
Symbian9 - Nono dígito para Symbian & programas que usam vCard (Outlook p.ex)
10/08/2012
- Adicionada opção para o formato 0XX11987654321, com ou sem zero no sufixo (Contribuição: Carlos Luizetto / Roberto Akama)
- Adicionada verificação da "gem vcard" para os casos em que o componente responsável pela leitura e edição de vCards não está instalado
02/08/2012
- Correção de bugs
- Lista de prefixos da Nextel (SME/trunking não faz parte da mudança) (Contribuição: Maurício Iwata)
- Adição do formato 9-XXXX-XXXX (Contribuição: Carlos Luizetto)
@mendelgusmao
mendelgusmao / redis_sessions.py
Created July 6, 2012 22:30 — forked from junkafarian/redis_sessions.py
Redis session management using a dictionary-like API for session objects
import redis
from zope.interface import Interface, implements
try: #pragma NO COVERAGE
import simplejson as json
except ImportError: #pragma NO COVERAGE
import json
class RedisSession(dict):
""" Provides a lazy interface for presenting data stored in a redis DB as a
@mendelgusmao
mendelgusmao / gist:2931935
Created June 14, 2012 18:21
AJAX Fluent Interface
function AJAXFluentInterface(uri) {
this.uri = uri || "";
this.retrieve = function(data, type) {
return $.ajax({
type: type || "GET",
url: this.uri,
dataType: "json",
data: data
@mendelgusmao
mendelgusmao / gist:2356310
Created April 11, 2012 01:53
high performance URL shortener on steroids using nginx, redis and lua
# based on http://uberblo.gs/2011/06/high-performance-url-shortening-with-redis-backed-nginx
# using code from http://stackoverflow.com/questions/3554315/lua-base-converter
# "database scheme"
# database 0: id ~> url
# database 1: id ~> hits
# database 2: id ~> [{referer|user_agent}]
# database 3: id ~> hits (when id is not found)
# database 4: id ~> [{referer|user_agent}] (when id is not found)
# database 5: key "count" storing the number of shortened urls; the id is generated by (this number + 1) converted to base 62
require "nokogiri"
require "open-uri"
require "fileutils"
list = File.open("bmbslsk.txt").read.split("\n").sort
#list = [list.first]
list.each do |url|
output_file = "D:/Devs/bmbslsk/" + url[/\d+/]
@mendelgusmao
mendelgusmao / gist:1566246
Created January 5, 2012 17:26
Deorkutizador de Pudim
javascript:document.body.innerHTML = '<table width="100%" height="100%" border=0 cellspacing=0 cellpadding=0 VALIGN=Middle ALIGN=CENTER><tr><td><center><br/><br/><br/><br/><br/><br/><br/><img src="http://www.pudim.com.br/SiteBuilder/UploadUsers/pudim.com.br/pudim.jpg"><br><font size="5">www.pudim.com.br</font><br><font size="3"><a href="mailto:pudim@pudim.com.br">pudim@pudim.com.br</a></font></center></td></tr></table>';document.head.innerHTML=document.head.innerHTML.replace(/<link.*>/, "");void(0);
@mendelgusmao
mendelgusmao / gist:1338366
Created November 4, 2011 00:33
Idea: scriptable rss downloader
hosts {
megaupload\.com
rapidshare\.com
filesonic\.com
4shared\.com
}
source www.bunalti.com/?feed=rss2 {
meta {
@mendelgusmao
mendelgusmao / gist:1337691
Created November 3, 2011 20:28
Passing a closure from front end to back end (just a dream)
A Closure object doesn't have a way to return its code as a string (i.e., like JavaScript has), so, it won't work.
@ front end (PHP >= 5.3):
$calls = new ClosureCall(
function ($a, $b) { return $a + $b; },
array(1, 2),
"var_dump"
);