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
* Reducing executable size: | |
http://developer.xamarin.com/guides/cross-platform/deployment,_testing,_and_metrics/memory_perf_best_practices/#Reducing_Executable_Size | |
* Use the linker (iOS [1], Android [2]) to remove unnecessary code from your assemblies | |
[1] https://developer.xamarin.com/guides/ios/advanced_topics/linker | |
[2] https://developer.xamarin.com/guides/android/advanced_topics/linking | |
* Reference third-party libraries judiciously | |
* Applying constraints to generics may reduce app size, since less code would need to be included (haven’t verified this) |
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
public class WebhooksFilterProvider : IWebHookFilterProvider | |
{ | |
private readonly Collection<WebHookFilter> filters = new Collection<WebHookFilter> | |
{ | |
new WebHookFilter | |
{ | |
Name = "NewInquiry", | |
Description = "new inquiry is raised." | |
}, | |
new WebHookFilter |
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
public class NotifyController : Controller | |
{ | |
[HttpPost] | |
public async Task<ActionResult> SubmitNewInquiry(string inquiryMessage) | |
{ | |
await this.NotifyAsync("NewInquiry", new { Message = inquiryMessage }); | |
return new EmptyResult(); | |
} | |
} |
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
public class WebHookHandler : Microsoft.AspNet.WebHooks.WebHookHandler | |
{ | |
public override Task ExecuteAsync(string receiver, WebHookHandlerContext context) | |
{ | |
return Task.FromResult(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
// | |
// the following code is extraction from https://code.msdn.microsoft.com/How-to-use-SqlDependency-5c0da0b3/sourcecode?fileId=158219&pathId=775745477 | |
// | |
public class ImmediateNotificationRegister<TEntity> : IDisposable where TEntity : class | |
{ | |
private SqlConnection connection = null; | |
private SqlCommand command = null; | |
private IQueryable iquery = null; | |
private ObjectQuery oquery = null; |
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
#Create a workspace project | |
ng new demo-ng6-lib-app | |
#Generate a new Library | |
ng generate library demo-ng6lib --prefix=dnl | |
#Build the Library | |
ng build --prod demo-ng6lib |
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 application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { | |
// Override point for customization after application launch. | |
let notificationTypes: UIUserNotificationType = [UIUserNotificationType.alert, UIUserNotificationType.badge, UIUserNotificationType.sound] | |
let pushNotificationSettings = UIUserNotificationSettings(types: notificationTypes, categories: nil) | |
application.registerUserNotificationSettings(pushNotificationSettings) | |
application.registerForRemoteNotifications() | |
return true | |
} | |
func application(_: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) { |
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
var certificateFilePath = "C:\\dev\\PushNotificationDemo\\cert.p12"; | |
var certificatePassword = ""; // We keep password empty | |
var config = new ApnsConfiguration (ApnsConfiguration.ApnsServerEnvironment.Sandbox,certificateFilePath, certificatePassword); | |
var broker = new ApnsServiceBroker (config); | |
broker.OnNotificationFailed += (notification, exception) => { | |
failed++; | |
}; | |
broker.OnNotificationSucceeded += (notification) => { | |
succeeded++; | |
}; |
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
function onConnected(cardHandle, protocol) | |
{ | |
//Load default encription key FF FF FF FF FF FF | |
APDU_SELECTKEY = [0xFF, 0x82, 0x20, 0x00, 0x06,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF]; | |
api.SCardTransmit( | |
cardHandle, | |
protocol == API.SCARD_PROTOCOL_T0 ? | |
API.SCARD_PCI_T0 : API.SCARD_PCI_T1, | |
APDU_SELECTKEY).then(function(result) { | |
result.get(function (ioRecvPci, response) { |
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
function onAuthenticated(protocol, response) | |
{ | |
sw = response.slice(-2); | |
if (sw[0] == 0x90 && sw[1] == 0x00) | |
{ | |
// Read block 1 (16 bytes) | |
APDU_READ = [0xFF, 0xB0, 0x00, 0x01, 0x10]; | |
readData(APDU_READ); | |
} | |
} |
OlderNewer