Skip to content

Instantly share code, notes, and snippets.

load '../config/environment.rb'
Vehicle.find_each(batch_size: 5000) do |loc|
sql = "SELECT vehicles.timestamp, vehicles.routetag FROM vehicles
WHERE ST_DWithin(
Geography(ST_MakePoint(stops.lon, stops.lat)),
Geography(ST_MakePoint(vehicles.lon, vehicles.lat)),
10
);"
ActiveRecord::Base.connection.execute(sql)
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<title>Info windows</title>
<style>
html, body, #map-canvas {
height: 100%;
margin: 0;
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<title>Simple markers</title>
<style>
html, body, #map-canvas {
height: 100%;
margin: 0;
startCash = 100;
while(startCash > 0){
var bet = prompt("Alright, time for you to loose some dough. Place a bet between 5 - 10 bucks.");
betAsInt = parseInt(bet);
startCash -= betAsInt;
var guess = prompt("Cool, so you've wagered " + bet + ". Now guess a number between 1 and 10");
function arrayOfLight(x){
array = [];
for(i=0; i <= x; i++){
array.push(i);
}
console.log(array);
}
arrayOfLight(5);