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
partial void Plants_Changed(NotifyCollectionChangedEventArgs e) | |
{ | |
if (e.Action == NotifyCollectionChangedAction.Add) | |
{ | |
var addedItem = e.NewItems[0] as HaulerPlant; | |
if (addedItem == null) return; | |
addedItem.IsActive = true; | |
} |
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
partial void Tickets_Created() | |
{ | |
this.FindControl("ScreenLayout").ControlAvailable += Tickets_ControlAvailable; | |
} | |
void Tickets_ControlAvailable(object sender, Microsoft.LightSwitch.Presentation.ControlAvailableEventArgs e) | |
{ | |
var screenLayout = e.Control as System.Windows.Controls.Grid; | |
if (screenLayout == null) return; |
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
using System; | |
using System.Collections.Generic; | |
namespace LightSwitchApplication | |
{ | |
/// <summary> | |
/// Generic Equality comparer that can be used of linq | |
/// </summary> | |
/// <typeparam name="T"></typeparam> | |
public class EqualityComparer<T> : IEqualityComparer<T> |
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
body | |
{ | |
background: url(TMMSCM.jpg) center bottom fixed; | |
background-repeat: no-repeat; | |
height: 100%; | |
width: 100%; | |
background-size: cover; | |
} |
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
async function updateAllCustomer(customers) { | |
const mapsPromises = customers.map(update); | |
//this will wait until all promise is resolved before going to next line | |
await Promise.all(mapsPromises); | |
console.log('Done!'); | |
} |
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
async function updateAllCustomer(customers) { | |
for (const customer of customers) { | |
await update(customer); | |
} | |
console.log('Done!'); | |
} |
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
<% | |
if (s.forceSsl) { | |
%> | |
server { | |
listen 80; | |
server_name <%-s.publicDomain%>; | |
# Used by Let's Encrypt |
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
import React from 'react' | |
//import {Mutation} from 'react-apollo' | |
import {Button, Icon} from 'native-base' | |
import {Mutation} from './Mutation' | |
import {ADD_USER, GET_USERS, generateId} from './queries' | |
const update = (cache, {data: {createUser}}) => { | |
const {allUsers} = cache.readQuery({query: GET_USERS}) | |
cache.writeQuery({ |
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
import React from 'react' | |
import {Mutation as MutationCore} from 'react-apollo' | |
import {AsyncStorage} from 'react-native' | |
// Pull serialized mutations from localstorage | |
const KEY = '@offlineQueueKey' | |
const getPending = async () => { | |
const obj = await AsyncStorage.getItem(KEY) | |
return JSON.parse(obj) || [] |
NewerOlder