This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(proto) | |
stat_smooth_func <- function (mapping = NULL, data = NULL, geom = "smooth", position = "identity", | |
method = "auto", formula = y ~ x, se = TRUE, n = 80, fullrange = FALSE, | |
level = 0.95, na.rm = FALSE, ...) { | |
StatSmoothFunc$new(mapping = mapping, data = data, geom = geom, position = position, | |
method = method, formula = formula, se = se, n = n, fullrange = fullrange, | |
level = level, na.rm = na.rm, ...) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE "public"."crime" ( | |
"id" serial, | |
"crime" character varying, | |
"lat" numeric, | |
"lon" numeric, | |
"reported_at" timestamp, | |
"type" character varying, | |
"the_geom" geometry, | |
PRIMARY KEY ("id") | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(ggplot2) | |
library(reshape) | |
library(plyr) | |
old_layout <- read.csv('log/old_layout.log', header=F, sep="\t") | |
old_layout <- old_layout$V1 | |
new_layout <- read.csv('log/new_layout.log', header=F, sep="\t") | |
new_layout <- new_layout$V1 | |
ds <- as.data.frame(cbind(old_layout[1:100], new_layout[1:100])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'selenium-webdriver' | |
module Scenario | |
def g2a_dashboard(driver, opts={}) | |
driver.get 'https://desk.gotoassist.com' | |
driver.find_element(:name, 'emailAddress').send_keys opts[:email] | |
driver.find_element(:name, 'password').send_keys opts [:password] | |
req_start = Time.now | |
driver.find_element(:id, 'credentials').submit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'net/https' | |
require 'nokogiri' | |
def parse_wout(w) | |
uri = URI.parse "https://www.endomondo.com/workouts/#{w}" | |
http = Net::HTTP.new(uri.host, uri.port) | |
http.use_ssl = true | |
req = Net::HTTP::Get.new uri.path | |
r = http.request(req) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT (route ->> 'lng')::float AS lng, | |
(route ->> 'lat')::float AS lat, | |
id AS endo_id, | |
TYPE | |
FROM | |
( SELECT json_array_elements(route) route, | |
id, | |
TYPE | |
FROM workouts LIMIT 5) w; |