git rebase -i --root -x "git commit --amend --reset-author -CHEAD"
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
// Toggling the 'feature-state' boolean via map.setFeatureState | |
'line-width': [ | |
'case', | |
['boolean', ['feature-state', 'hover'], false], | |
10, | |
2 | |
] |
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
// You can edit source data on the fly but it requires it to have a layer first, as there is no way to directly access GeoJSON | |
// GeoJson is only exposed via querySourceFeatures, grabbing features from a map's layer | |
const yourSourceId = 'some-source'; | |
const url = 'some-url'; | |
map.addSource(yourSourceId, { | |
type: 'geojson', | |
data: url |
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
//Adjust the scroll if we think the card content is going out of viewable bounds | |
fitCardInView = () => { | |
this.props.setAnimatingMap(true); | |
if (!this.cardView || !this.cardView.measureInWindow) { | |
return false; | |
} | |
this.cardView.measureInWindow((x, y, width, height) => { | |
// console.log(this.layout.height, y); |
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
val webView = findViewById<WebView>(R.id.tosWebView) | |
webView.visibility = 1 | |
webView.webViewClient = WebViewClient() | |
webView.settings.javaScriptEnabled = true | |
webView.settings.domStorageEnabled = true | |
webView.overScrollMode = WebView.OVER_SCROLL_NEVER | |
webView.loadUrl(R.string.tos_url.toString()) |
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
this.setState({ | |
webViewUri: "https://transitscreen.com/termsofuse", | |
webViewDisplay: "flex" | |
}); | |
<WebView | |
source={{uri:this.state.webViewUri}} | |
style={{height:400, width: 380, flex: 2, display: this.state.webViewDisplay}} | |
onError={console.error.bind(console, 'error')} | |
bounces={false} |
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
// Obtained from https://github.com/ivansams at https://jsfiddle.net/ivansams/tw7qLvh4/2/ | |
// Only the function that converts polyline to geojson coordinates for Mapbox integration | |
// Was previously called GetGeoJSON, but this function simply returns a flat array of polylines in [lng, lat] format | |
function getCoordsFromPolyline(str, precision) { | |
var precision = precision || 5; // Precision as 5 yields 00.000 | |
var index = 0, | |
lat = 0, | |
lng = 0, | |
coordinates = [], |
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
<?php | |
function parseHours($value) { | |
$hours = json_decode($value); | |
$hours = (array)$hours; | |
foreach ($hours as $day => $hourstring) { | |
$time = explode("-", $hourstring); | |
$time[0] = trim(str_replace(' ', '', $time[0])); | |
if (isset($time[1])) { |
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
func log(text: String, pauseLog: Bool) { | |
let newDate = Date() | |
let dateFormatter = DateFormatter() | |
dateFormatter.locale = Locale(identifier: "en_US") | |
dateFormatter.setLocalizedDateFormatFromTemplate("HH:mm:ss") | |
let displayDate = dateFormatter.string(from: newDate) + ": " | |
let newLogText = (self.outputText.text ?? "\n") + displayDate + text + "\n" | |
print(newLogText) |
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
func numberOfComponents(in pickerView: UIPickerView) -> Int { | |
return 1 | |
} | |
func pickerView(_ pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int { | |
return pickerDataSource.count; | |
} | |
func pickerView(_ pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String? { | |
return pickerDataSource[row] |
NewerOlder