Skip to content

Instantly share code, notes, and snippets.

View cdeutsch's full-sized avatar
👨‍🏭
Hire me! Fullstack Engineer open to new developer or manager opportunities.

Christopher Deutsch cdeutsch

👨‍🏭
Hire me! Fullstack Engineer open to new developer or manager opportunities.
View GitHub Profile
using BundleTransformer.Core.Orderers;
using BundleTransformer.Core.Transformers;
using System.Web;
using System.Web.Optimization;
namespace Xamarin.Web.SalesTools
{
public class BundleConfig
{
// For more information on Bundling, visit http://go.microsoft.com/fwlink/?LinkId=254725
<less useNativeMinification="false" ieCompat="true"
strictMath="false" strictUnits="false"
dumpLineNumbers="None">
<jsEngine name="V8JsEngine" />
</less>
using Agvise.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Principal;
using System.Text;
using System.Web;
namespace www.Infrastructure
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Text;
using System.Web.Mvc.Html;
using System.Collections;
using System.Linq.Expressions;
using System.Web.Routing;
using System.Reflection;
public override bool FinishedLaunching (UIApplication app, NSDictionary options)
{
JsBridge.EnableJsBridge();
window = new UIWindow (UIScreen.MainScreen.Bounds);
// get useragent
UIWebView agentWebView = new UIWebView ();
var userAgent = agentWebView.EvaluateJavascript ("navigator.userAgent");
agentWebView = null;
@cdeutsch
cdeutsch / gist:6707396
Last active October 31, 2018 22:28
Code to customize the UserAgent in Xamarin.iOS
// get useragent
UIWebView agentWebView = new UIWebView ();
var userAgent = agentWebView.EvaluateJavascript ("navigator.userAgent");
agentWebView = null;
userAgent += " XamarinBarcodeSampleApp";
// set default useragent
NSDictionary dictionary = NSDictionary.FromObjectAndKey(NSObject.FromObject(userAgent), NSObject.FromObject("UserAgent"));
NSUserDefaults.StandardUserDefaults.RegisterDefaults(dictionary);
@using (Html.BeginForm(null, null, FormMethod.Post, new { @class = "form-signin" })) {
<h3>Scan Your Promo Code</h3>
<table class="form-group">
<tr>
<td>
@Html.TextBoxFor(mm => mm.PromoCode, new { placeholder = "Promo code", autofocus = "", @class = "form-control" })
</td>
@if (Request.UserAgent.Contains("XamarinBarcodeSampleApp"))
{
@cdeutsch
cdeutsch / gist:6707524
Last active December 23, 2015 23:08
Wire up Scan button in Xamarin.Web.BarcodeSample app
<script type="text/javascript" src="~/scripts/mt.js"></script>
<script type="text/javascript">
$(document).ready(function () {
// listen for scan finished event triggered from native code.
Mt.App.addEventListener('scanComplete', function (data) {
if (data && data.code) {
if (confirm('Use the code ' + data.code + '?')) {
$('#PromoCode').val(data.code);
}
}
SELECT ISNULL(NULLIF(ca.Value, ''), cc.Email) AS 'Company',
SUM([OrderTotal]) as Total,
SUM([OrderTotal]-RefundedAmount) as AdjustedTotal
FROM [dbo].[Nop_Order] oo
INNER JOIN Nop_Customer cc on oo.CustomerID = cc.CustomerID
LEFT OUTER JOIN Nop_CustomerAttribute ca on cc.CustomerId = ca.CustomerId and ca.[Key] = 'Company'
WHERE RefundedAmount < OrderTotal
AND OrderTotal > 0
GROUP BY ISNULL(NULLIF(ca.Value, ''), cc.Email)
ORDER BY AdjustedTotal DESC
SELECT Who_FirstName, Who_LastName, ll.Email, (SUM(VSWinCount) + SUM(XSWinCount) + SUM(XSMacCount)) AS Activity
FROM OPENQUERY(DBAMP, 'SELECT Who.FirstName, Who.LastName, WhoId, Subject FROM Task WHERE Subject LIKE ''Started Trial:%'' AND ActivityDate > 2013-08-07 ') AS tt
INNER JOIN OPENQUERY(DBAMP, 'SELECT Id, Email FROM Lead') ll ON tt.WhoId = ll.Id
INNER JOIN OPENQUERY(STOREREPLICA, 'SELECT * FROM StoreReplica.dbo.Nop_Customer_NoXML') cc ON ll.Email = cc.Email COLLATE Latin1_General_CI_AS
INNER JOIN OPENQUERY(STOREREPLICA, 'SELECT * FROM StoreReplica.dbo.xam_Activity_OsIde_Counts WHERE VSWinCount > 0 OR XSWinCount > 0 OR XSMacCount > 0') aoic ON cc.CustomerId = aoic.CustomerId
GROUP BY Who_FirstName, Who_LastName, ll.Email
ORDER BY Activity DESC