http://www.nextbus.com/xmlFeedDocs/NextBusXMLFeed.pdf
http://webservices.nextbus.com/service/publicXMLFeed?command=agencyList
Obtain a list of available transit agencies.
const assert = require('assert'); | |
function *sweetFunction(array) { | |
const colCount = array[0].length; | |
const rowCount = array.length; | |
const diagonalCount = 1 << (Math.max(colCount, rowCount) - 1); | |
for (let d = 0; d <= diagonalCount; ++d) { | |
const minR = d >= colCount ? d - colCount + 1 : 0; | |
let r = d < rowCount ? d : rowCount - 1; |
#!/bin/bash | |
if [ -z "$1 " ] | |
then | |
today=$(date '+%Y-%m-%d') | |
else | |
today=$1 | |
fi | |
file="$today.txt" |
#!/bin/bash | |
git log --pretty=format:"%cr - %s" --no-merges -7 |
http://www.nextbus.com/xmlFeedDocs/NextBusXMLFeed.pdf
http://webservices.nextbus.com/service/publicXMLFeed?command=agencyList
Obtain a list of available transit agencies.
#!/bin/bash | |
curl -s http://webservices.nextbus.com/service/publicJSONFeed\?command\=predictions\&a\=sf-muni\&r\=3\&s\=6604 | jq '.predictions.direction.prediction[0].minutes' |
const fs = require('fs'); | |
const rawCsv = fs.readFileSync('export.csv', 'utf8'); | |
const lines = rawCsv.split('\n'); | |
const headers = lines.shift().split(',').map(h => h.trim()); | |
const csv = lines | |
.map(l => { | |
const cols = l.split(',').map(c => c.trim()); | |
if (cols.length === headers.length) { | |
return headers.reduce((obj, h, i) => { |
((items) => { | |
convertEmoji = str => { | |
// Converts a string of characters to CSS escapes | |
// str: sequence of Unicode characters | |
let highsurrogate, outputString; | |
highsurrogate = 0; | |
outputString = ''; | |
for (let i = 0; i < str.length; i++) { | |
let cc = str.charCodeAt(i); | |
if (cc < 0 || cc > 0xFFFF) { |
export default rgb2hex = rgb => rgb.trim() | |
.replace(/^rgb\(|\)/g, '') | |
.split(',') | |
.reduce((str, v) => str + parseInt(v).toString(16).padLeft(2, '0'), '#'); |
// old way of doing it | |
var number = $('<div class="number"></div>'); | |
var articleNumber = i +1; | |
if(articleNumber < 10) { | |
number.text('0' + articleNumber); | |
} else { | |
number.text(articleNumber); | |
} | |
// but instead do this |