This file contains hidden or 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
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) |
This file contains hidden or 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
<!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; |
This file contains hidden or 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
<!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; |
This file contains hidden or 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
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"); |
This file contains hidden or 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
function arrayOfLight(x){ | |
array = []; | |
for(i=0; i <= x; i++){ | |
array.push(i); | |
} | |
console.log(array); | |
} | |
arrayOfLight(5); |