Skip to content

Instantly share code, notes, and snippets.

View fczuardi's full-sized avatar

Fabricio C Zuardi fczuardi

View GitHub Profile
@fczuardi
fczuardi / get_property_names_translations.mql
Created August 17, 2008 18:44
Get all the property names in all available languages plus the type name in all languages for a given id.
{
"/type/type/properties" : [
{
"id" : null,
"name" : [
{
"lang" : null,
"value" : null
}
]
{
"id" : "/user/fabricio/brazilian_government/politician/quotations",
"name" : [
{
"connect" : "insert",
"lang" : "/lang/pt",
"type" : "/type/text",
"value" : "Citações"
}
]
{
"politicos" : {
"cursor" : true,
"query" : [
{
"/common/topic/image" : {
"guid" : null,
"limit" : 1,
"optional" : true
},
@fczuardi
fczuardi / members_info.php
Created August 23, 2008 20:26
Members Data Table for Ning.com social networks
<?php
/**
* Detailed Members Table
* Display a detailed list of members for a particular network containing
* all answers for the profile questions, you can sort by any field
*
* Author: Fabricio Campos Zuardi (fabricio@gmail.com)
**/
//parameters
@fczuardi
fczuardi / gist:7029
Created August 25, 2008 04:34
guess the output
<?php
$b = .08 + .07;
var_dump($b);
var_dump(.15 - $b);
var_dump((bool)(.15 - $b));
?>
--- texto_corrido_ptBr_only_ptBr.srt
+++ (clipboard)
@@ -4,7 +4,7 @@
2
00:01:21,357 --> 00:01:24,861
-embora ele seja mal como pode
+embora ele seja maldoso demais
3
@fczuardi
fczuardi / standardsyntax.js
Created April 13, 2010 20:49
Wiki Creole syntax highlight for Bespin
syntaxInfoForLineFragment: function(context, state, line, start, end) {
var promise = new Promise();
var attrs = [];
var stickySupported = this._stickySupported;
line = line + '\n'
var lineLength = line.length;
var states = this.get('states');
Ministério da saúde has left a new comment on your post "Precisamos de um Youtube.gov? (parte II)":
Caro blogueiro,
A vacina contra Influenza H1N1, que já matou YADDA YADDA YADDA YADDA YADDA SPAM
SPAM SPAM YADDA YADDA (editei o conteúdo p/ não fazer propaganda de graça p/ você)
Por isso, é muito importante YADDA YADDA YADDA YADDA YADDA SPAM SPAM SPAM YADDA YADDA
Para mais informações sobre YADDA YADDA YADDA YADDA YADDA SPAM SPAM
@fczuardi
fczuardi / calc.js
Created September 12, 2010 04:14
jerkenstein calc plugin
var basic = /[0-9\+\-\*\/\%\.\,\(\)\s]/
,math_properties = /E|LN2|LN10|LOG2E|LOG10E|PI|SQRT1_2|SQRT2/
,math_methods = /abs|acos|asin|atan|atan2|ceil|cos|exp|floor|log|max|min|pow|random|round|sin|sqrt|tan/
,pattern = new RegExp('^\\?calc (('+basic.source+'|Math\\.('+math_properties.source+'|(('+math_methods.source+')\\()))+)$')
this.plugin = {
'name': 'calc'
,'pattern': pattern
,'description': 'Calculate basic arithmetic.'
@fczuardi
fczuardi / blame.js
Created September 12, 2010 04:24
jerkenstein blame plugin
this.plugin = {
'name': 'blame'
,'pattern': /^\?blame (.+)$/
,'description': 'Find out who was the responsible for something.'
,'example': '?blame Who let the dogs out?'
,'action': function(message) {
message.say(message.user + ': Do you want to know ' + message.match_data[1] + ' Of course it was Paul Lloyd!')
}
,'url': 'http://gist.github.com/575841'
}