Skip to content

Instantly share code, notes, and snippets.

View matthieugd's full-sized avatar

Matthieu Guyonnet-Duluc matthieugd

  • Montreal, Quebec, Canada
View GitHub Profile
<html>
<head>
<script>
let userLatitude = parseFloat('45.532032');
let userLongitude = parseFloat('-73.595368');
let stationsInfosEndpoint = 'https://api-core.bixi.com/gbfs/en/station_information.json';
let stationsStatusEndpoint = 'https://api-core.bixi.com/gbfs/en/station_status.json';
let xhr = new XMLHttpRequest();
function applyCostPerimeter(userAttributes) {
if (userAttributes.hasOwnProperty('manually.admin') || userAttributes.hasOwnProperty('saml.admin')) {
return {
"costPerimeterDefinition" : null,
"roles" : ['ADMIN'],
};
} else {
return {
"costPerimeterDefinition" : {
{
"metadata": {},
"data": {
"Azure/uksouth": {
"Virtual Machines": {
"Compute Hours": {
"Standard_D12_v2 VM": {
"cost": {
"pricingModelWithSupportCharges": 4.37
}
[
{
"user:Environment": ["Production"],
"user:Application": ["Project A"],
"user:Component": [".*frontend.*"]
}
]
[
{
"user:Environment": ["Development"],
"user:Application": ["Project A"]
}
]
[
{
"user:Environment": ["Production"],
"user:Application": ["Project A","Project B"],
"user:Component": ["Frontend"]
},
{
"user:Environment": ["Development"],
"user:Application": ["Project B"],
"user:Component": ["Backend"]
Snippet Name: Android Behavior - WPF Style
Platform(s): Xamarin.Android
Function: Reproduce the beloved WPF behaviors in Android
Snippet:
public abstract class Behavior<T> : View where T:View
{
int _viewId;
protected Behavior(Context context, IAttributeSet attrs)