Skip to content

Instantly share code, notes, and snippets.

Avatar

fiatjaf fiatjaf

View GitHub Profile
@fiatjaf
fiatjaf / keybase.md
Created Mar 24, 2014
Proof that I am fiatjaf on keybase.io
View keybase.md

Keybase proof

I hereby claim:

  • I am fiatjaf on github.
  • I am fiatjaf (https://keybase.io/fiatjaf) on keybase.
  • I have a public key whose fingerprint is 1D05 7FBD 3171 53FB ECED 6929 8F81 0203 6444 CDD2

To claim this, I am signing this object:

@fiatjaf
fiatjaf / olavo.js
Last active Aug 29, 2015
garimpador de posts do olavo de carvalho
View olavo.js
// jquery
window.posts = {}
var fetch = function () {
$('div[role="article"] span.fcg span.fwb a[href^="https://www.facebook.com/olavo.decarvalho"]').each(function () {
var post = {}
var elem = $(this).closest('div[role="article"]')
if (!elem) return
View groupon.ethereum
if (tx.value < 100 * block.basefee) {
return
}
if (tx.data[0] == 'BUY') {
// buy deal
payment = tx.value - 100 * block.basefee
shareholders = contract.storage['sh']
deal = contract.storage[tx.data[1]]
if (payment >= deal.price*1.02) {
@fiatjaf
fiatjaf / command.js
Last active Aug 29, 2015
in a couchapp's entry page,this bookmarklet opens a form into which you can type your login and password and start a session.
View command.js
var form = '<div style="position:absolute;left:50%;top:50%;margin-left:-150px;margin-top:-100px;width:300px;height:200px;"><form id="loginForm"><input placeholder="nome" name="name"><input placeholder="senha" type="password" name="password"><button onclick="login(event)">OK</button></form></div>';
document.write(form);
function login(event) {
event.preventDefault();
event.returnValue = false;
var form = document.getElementById('loginForm');
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function () {
if (xhr.readyState === 4) {
@fiatjaf
fiatjaf / recover.js
Last active Aug 29, 2015
bookmarklet bhiss salvar-recuperar
View recover.js
(function () {
var fields = {
'form:numDocumento': 'value',
'form:dnomeRazaoSocial': 'value',
'form:cep': 'value',
'form:logradouro': 'value',
'form:numero': 'value',
'form:complemento': 'value',
'form:bairro': 'value',
'form:municipioTomadorServico': 'value',
@fiatjaf
fiatjaf / README.md
Last active Aug 29, 2015
a bl.ocks example of ReactLineChart
View README.md
@fiatjaf
fiatjaf / map.geojson
Last active Aug 29, 2015
mapa de referências diretas e indiretas do Uma Nova História da Música, Otto Maria Carpeaux
View map.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@fiatjaf
fiatjaf / README.md
Last active Aug 29, 2015
websitesfortrello.com utils
View README.md
@fiatjaf
fiatjaf / docs.websitesfortrello.css
Last active Aug 29, 2015
Small CSS and JS includes
View docs.websitesfortrello.css
body > header, body > aside { background-color: #2DB284 !important }
@fiatjaf
fiatjaf / README.md
Last active Oct 7, 2015
opinionated URL normalization function written in PL/pgSQL
View README.md

A function that takes a URL string and returns it with

  • https replaced by http (all sites support http endpoints, only some support https);
  • www. removed (all sites should support naked domains);
  • ending slash / removed from path;
  • lowercased domain (but not path);
  • querystring parameters removed, except those listed in the allowed_params table, which expects records like the following:
              hostpath               |  param