Skip to content

Instantly share code, notes, and snippets.

View jlbelmonte's full-sized avatar

murrico jlbelmonte

  • whocares.ltd
  • earth
View GitHub Profile
@jlbelmonte
jlbelmonte / apibunny.py
Last active August 29, 2015 14:00
apibunny
import requests
from sets import Set
_seed = 'http://apibunny.com/cells/taTKQ3Kn4KNnmwVI'
_base = 'http://apibunny.com/cells/'
visited = Set()
def processJson(json) :
cells = json.get('cells')[0]
@jlbelmonte
jlbelmonte / isProbablyWrongEncoded.java
Last active December 17, 2015 03:29
tiny util method to verify if a text had an issue with encodings. Only works for texts with a high incidence of the issue.
public static boolean isProbablyWrongEncoded(String s){
int charNum = s.length();
float wordCount = 1.0f;
float auxCharCount =0.0f;
float ctrlCharCount =0.0f;
for (int i =0; i < charNum; i++) {
int cp = Character.codePointAt(s, i);
if (s.charAt(i) == ' ') {
wordCount ++;
qSort :: (Ord a) => [a] -> [a]
qSort [] = []
qSort (x:xs) =
let left = qSort (filter (<=x) xs)
right = qSort (filter(>x) xs)
in left ++ [x] ++ right
@jlbelmonte
jlbelmonte / gist:2974237
Created June 22, 2012 17:55
n-ary tree univalence
import java.util.ArrayList;
import java.util.List;
/* root with three children
O
/ | \
O O O
/ / \ \ | \
O O O O O O
INFO ~ [GitHubCollector] git://github.com/mochidev/MDSpreadView.git isNew: true
ERROR ~ NO XLIMIT : https://api.github.com/repos/mochidev/MDSpreadView/commits?page=1&per_page=100
ERROR ~ HEADERS :
{ null=[HTTP/1.1 200 OK],
Status=[200 OK],
ETag=["6a3f7cea142e2824a2fbe1f262e11ef9"],
Date=[Wed, 23 May 2012 17:06:36 GMT],
Content-Length=[49245],
Connection=[keep-alive],
Content-Type=[application/json; charset=utf-8],
<?xml version="1.0" encoding="utf-8"?>
<contentlocation xmlns:yahoo="http://www.yahooapis.com/v1/base.rng" xmlns="http://wherein.yahooapis.com/v1/schema" xml:lang="en">
<processingTime>0.001451</processingTime>
<version>1.5.0.657 build 120227</version>
<documentLength>48</documentLength>
<document>
<administrativeScope>
<woeId>7153320</woeId>
<type>State</type>
<name>
@jlbelmonte
jlbelmonte / location1.xml
Created May 22, 2012 18:59
Saint-Guilhem-le-Désert, France
<?xml version="1.0" encoding="utf-8"?>
<contentlocation xmlns:yahoo="http://www.yahooapis.com/v1/base.rng" xmlns="http://wherein.yahooapis.com/v1/schema" xml:lang="en">
<processingTime>0.001445</processingTime>
<version>1.5.0.657 build 120227</version>
<documentLength>32</documentLength>
<document>
<administrativeScope>
<woeId>624494</woeId>
<type>Town</type>
<name>
@jlbelmonte
jlbelmonte / format.json
Created November 30, 2011 19:28
commit format
[
{"revision":"5c5afa47cf7cd15d5366aca5c0fb40607e5288f2",
"author":"Juan Luis Belmonte <jlbelmonte@gmail.com>",
"timestamp":"1322532384",
"message":"removed bashisms",
"added":[],
"modified":["git/masterbranch.sh"],
"deleted":[],
"other":[]},
{"revision":"d6d2b3258cb0e38b900a593b6a176d8907ce1ccd",
@jlbelmonte
jlbelmonte / gist:636389
Created October 20, 2010 13:24
Congratulations for your third birthday.
(
(
) ) (
) (o) )
( (o) ) ,|, )
(o) ,|, |~\ ( (o)
,|, |~\ ( \ | (o) ,|,
\~| \ | (o) |`\ ,|, |~\
|`\ |`\@@@,|,@@@@\ |@@@\~| \ |
\ | o@@@\ |@@@\~|@@@@|`\@@@|`\@@@o |`\
#!/bin/bash
SNAPID="SNAP"
BACKUPDBID="TEMPDB"
#config groups
SECURITYGROUP="Mysecgrup"
PARAMSGROUP="Myparamsgrup"
#rds verifying commands