Skip to content

Instantly share code, notes, and snippets.

View fdc263's full-sized avatar

Francisco DC fdc263

View GitHub Profile
@fdc263
fdc263 / issuu.php
Created June 19, 2012 19:03 — forked from atinypixel/issuu.php
Issuu API Client for PHP
<?php
/**
* IssuuClient hooks into Issuu's API
*
* example:
* include 'IssuuClient.php';
* $issuu = new IssuuClient(pubKey, privKey, apiAdr);
* $issuu->openAction('issuu.document.url_upload');
* $issuu->slurpUrl = 'pdfurl.pdf';
* $issuu->executeAction();
@fdc263
fdc263 / flot labels
Created July 19, 2012 13:56 — forked from colinfwren/flot labels
Code for flot labelling project
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>How to add labels to a flot graph</title>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<style>
body{
padding: 1em;
@fdc263
fdc263 / gist:7e7789e49ce26b0b249c
Created February 13, 2015 23:49
Objeto Javascript para validação de números de telefone celulares brasileiros, de acordo com as regras da ANATEL.
/*
Usage:
To validate area code and number:
br_mobile.validate('11', '912345436')
br_mobile.validate('54', '12345436')
return true or false
To check if area code require 9 digits
br_mobile.require_ninth_digit('11')
return true, false or undefined (if area code is invalid)
To get the required length of phone number (without area code)
Aceguá ; Sul ; RS
Água Santa ; Norte ; RS
Agudo ; Centro ; RS
Ajuricaba ; Norte ; RS
Alecrim ; Oeste ; RS
Alegrete ; Sul ; RS
Alegria ; Norte ; RS
Almirante Tamandaré do Sul ; Norte ; RS
Alpestre ; Norte ; RS
Alto Alegre ; Centro ; RS
@fdc263
fdc263 / benchmark.rb
Created May 2, 2016 16:35
Ruby multi-line string benchmark
require 'benchmark'
iterations = 100_000
store = {'name' => 'Store name', 'host' => 'www.store-url.com'}
Benchmark.bm do |bm|
bm.report do
iterations.times do
"".tap do |code|
@fdc263
fdc263 / order.json
Last active May 6, 2016 18:26
Proposal of default json mapping
{
"code": "",
"status": "",
"createdDate": "",
"confirmedDate": "",
"canceledDate": "",
"fulfillmentStatus": "",
"shippedDate": "",
"deliveredDate": "",
"paymentInformation": {