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
public static class Services | |
{ | |
public static bool isOffline | |
{ | |
get; set; | |
} | |
} | |
public class APIService | |
{ |
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
public class APIService { | |
public virtual string UserId { | |
get { | |
return _userId; | |
} | |
} | |
public virtual void Login() | |
{ | |
// send request to server here |
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
using System; | |
public static class Services | |
{ | |
public static IAPIService api { get { return _api.Value; } } | |
public static bool isOffline { get; set; } | |
private static Lazy<IAPIService> _api = new Lazy<IAPIService>(() => isOffline | |
? (IAPIService)new OfflineAPIService() | |
: new APIService()); |
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
using System; | |
public class Lazy<T> { | |
public Lazy(Func<T> factory) | |
{ | |
if (factory == null) | |
{ | |
throw new ArgumentNullException("Lazy<T> doesn't accept null factory"); | |
} |
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
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public static class Services | |
{ | |
public static Lazy<ILogger> log = new Lazy<ILogger>(() => | |
{ | |
return new UserIdUnityLogger(api); | |
}); |
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
public class APIService : IAPIService | |
{ | |
private readonly Lazy<ILogger> _logger; | |
public APIService() | |
{ | |
_logger = Services.log; | |
} | |
public string UserId { get; private set; } |
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
az account set --subscription $SubscriptionID | |
snapshotId=$(az snapshot show -g $ResourceGroupName -n $snapshotName --query "id" -o tsv ) | |
# Get the SAS for the snapshotId | |
snapshotSasUrl=$(az snapshot grant-access -g $ResourceGroupName -n $snapshotName --duration-in-seconds 3600 -o tsv) | |
# Setup the target storage account in another region | |
targetStorageAccountKey=$(az storage account keys list -g $ResourceGroupName --account-name $targetStorageAccountName --query "[:1].value" -o tsv) | |
storageSasToken=$(az storage account generate-sas --expiry 2017-05-02'T'12:00'Z' --permissions aclrpuw --resource-types sco --services b --https-only --account-name $targetStorageAccountName --account-key $targetStorageAccountKey -o tsv) |
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
[alarm@alarmpi records]$ motion | |
[37881728:motion] [NTC] [ALL] conf_load: Processing thread 0 - config file /etc/motion/motion.conf | |
[37881728:motion] [NTC] [ALL] motion_startup: Motion 4.1.1 Started | |
[37881728:motion] [NTC] [ALL] motion_startup: Logging to syslog | |
[37881728:motion] [NTC] [ALL] motion_startup: Using log type (ALL) log level (DBG) | |
[37881728:motion] [INF] [ALL] conf_output_parms: Writing configuration parameters from all files (1): | |
[37881728:motion] [INF] [ALL] Thread 0 - Config file: /etc/motion/motion.conf | |
[37881728:motion] [INF] [ALL] daemon off | |
[37881728:motion] [INF] [ALL] process_id_file /var/run/motion/motion.pid | |
[37881728:motion] [INF] [ALL] setup_mode off |
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
{ | |
"problemMatcher": { | |
"owner": "python", | |
"fileLocation": [ | |
"relative", | |
"${workspaceFolder}" | |
], | |
"pattern": { | |
"regexp": "^(.*):(\\d+):(\\d+):\\s+(W|E).+:\\s+(.*)$", | |
"file": 1, |
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
#!/bin/bash | |
mkdir -p out | |
convert *.JPG -background white -resize "1500x1500" -gravity Center -extent 1500x1500 -rotate 90 -set filename:f '%t' out/'%[filename:f].png' |