Skip to content

Instantly share code, notes, and snippets.

@fmacias64
fmacias64 / login.html
Created September 25, 2019 18:50 — forked from lanxan/login.html
login & register with ajax
<html>
<head>
<title>login</title>
<script type="text/javascript" >
function id(id){
return document.getElementById(id);
}
function setCookie(c_name,value,expiredays){
var exdate=new Date();
exdate.setDate(exdate.getDate()+expiredays);
#based on https://cran.r-project.org/web/packages/ggjoy/vignettes/gallery.html
library(viridis)
library(ggjoy)
library(aire.zmvm)
library(lubridate)
library(ggplot2)
library(dplyr)
library(tidyr)
temp <- get_station_data(criterion = "HORARIOS", # Can be one of MAXIMOS (daily maximum),
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@fmacias64
fmacias64 / test.py
Created February 5, 2016 01:11 — forked from christianroman/test.py
Bypass Captcha using 10 lines of code with Python, OpenCV & Tesseract OCR engine
import cv2.cv as cv
import tesseract
gray = cv.LoadImage('captcha.jpeg', cv.CV_LOAD_IMAGE_GRAYSCALE)
cv.Threshold(gray, gray, 231, 255, cv.CV_THRESH_BINARY)
api = tesseract.TessBaseAPI()
api.Init(".","eng",tesseract.OEM_DEFAULT)
api.SetVariable("tessedit_char_whitelist", "0123456789abcdefghijklmnopqrstuvwxyz")
api.SetPageSegMode(tesseract.PSM_SINGLE_WORD)
tesseract.SetCvImage(gray,api)
print api.GetUTF8Text()
@fmacias64
fmacias64 / topsy_search.py
Created November 10, 2015 07:31 — forked from judotens/topsy_search.py
Topsy search scraper
# scrape tweets from topsy.com
import sys, urllib, urllib2, json, random
def search(query):
data = {'q': query, 'type': 'tweet', 'offset': 1, 'perpage': 1000, 'window': 'a', 'sort_method': "-date", 'apikey': '09C43A9B270A470B8EB8F2946A9369F3'}
url = "http://otter.topsy.com/search.js?" + urllib.urlencode(data)
data = urllib2.urlopen(url)
o = json.loads(data.read())
res = o['response']
@fmacias64
fmacias64 / client.js
Created October 3, 2015 12:00 — forked from nkhine/client.js
Viewing OpenLearn Mindmaps Using d3.js
var m = [0, 120, 20, 320],
w = 1280 - m[1] - m[3],
h = 800 - m[0] - m[2],
i = 0,
root;
var tree = d3.layout.tree()
.size([h, w]);
var diagonal = d3.svg.diagonal()
import lsh
lsh_machine = lsh.LSH(assignment_name="example")
# data is a dictionary of the form:
#{user_id: set([item_id1, item_id2, ...]), ...}
# Depending on the input size, training can take a while.
# But it will use all your cores to do so, and will
# automatically cache the data for assignment_name. This