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.

C Deutsch cdeutsch

👨‍🏭
Hire me! Fullstack Engineer open to new developer or manager opportunities.
View GitHub Profile
@cdeutsch
cdeutsch / gist:7604850
Last active December 29, 2015 02:59
Find Empty Salesforce Accounts
SELECT Id, Name, CreatedDate, LastModifiedDate
FROM (
SELECT Id, Name, CreatedDate, LastModifiedDate
FROM OPENQUERY(DBAMP, 'select * from Account')
WHERE Account_Profile__c IS NULL
AND Account_Stage__c IS NULL
AND Account_Tier__c IS NULL
AND AccountNumber IS NULL
AND Annual_Revenue_in_millions__c IS NULL
AND AnnualRevenue IS NULL
HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.OK);
response.Content = new StringContent(<SOME OBJECT CONVERTED TO STRING FORMAT>);
response.Content.Headers.ContentType = new MediaTypeHeaderValue("application/xml");
return response;
SELECT [Year], [Month], [Description], SUM(RenewalPrice)
FROM (
SELECT YEAR(CONVERT(datetime, Subscription__r_Renewal_Date__c)) AS [Year], MONTH(CONVERT(datetime, Subscription__r_Renewal_Date__c)) AS [Month], CONVERT(nvarchar(500), [Description]) AS [Description], Subscription__r_Renewal_Price__c AS [RenewalPrice]
FROM OPENQUERY(DBAMP, '
SELECT Id, Description, Subscription__r.Renewal_Date__c, Subscription__r.Renewal_Price__c
FROM Asset
')) AS tmp
GROUP BY [Year], [Month], [Description]
ORDER BY [Year], [Month], [Description]
SELECT oo.*
FROM Nop_Order oo
LEFT OUTER JOIN Nop_OrderProductVariant opv ON oo.OrderID = opv.OrderID
LEFT OUTER JOIN Nop_ProductVariant pv ON opv.ProductVariantID = pv.ProductVariantId
WHERE pv.Sku LIKE '% REN'
-- sum by year/month
SELECT subs.Year, subs.Month,
SUM(FirstOrderTotal) AS [FirstOrderTotal],
SUM(FuturOrderTotals) AS [FuturOrderTotals],
SUM(LookupRenewalValue) AS [LookupRenewalValue],
SUM(FactoredRenewaValue) AS [FactoredRenewaValue]
FROM (
-- get first and future order totals
SELECT cs.CustomerId, YEAR(cs.CreatedOn) AS [Year], MONTH(cs.CreatedOn) AS [Month],
var irc = require("irc");
var pushover = require( 'pushover-notifications' );
// Create the configuration
var ircConfig = {
channels: ["#web", "#dogs"],
server: "irc.company.com",
botName: "nodebot",
watch: 'christopher'
};
using System;
using System.Collections.Generic;
using System.Linq;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
using Alchemy;
using Alchemy.Classes;
using System.Net.Http;
using Newtonsoft.Json;
SELECT 34 AS [product_id],
SUBSTRING(CAST(NEWID() AS nvarchar(50)), 1, 5) + '-' + SUBSTRING(CAST(NEWID() AS nvarchar(50)), 1, 5) + '-' + SUBSTRING(CAST(NEWID() AS nvarchar(50)), 1, 5) + '-' + SUBSTRING(CAST(NEWID() AS nvarchar(50)), 1, 5) + '-' + SUBSTRING(CAST(NEWID() AS nvarchar(50)), 1, 5) AS [license_code], -- can we gen this from SQL or join into a table of available codes?
0 AS [refunded],
UniversityStartDate AS [purchase_ts],
null AS [order_id],
CustomerID AS [customer_id],
CustomerID AS [user_id],
UniversityStartDate AS [first_activation_ts],
UniversityEndDate AS [valid_until_ts],
NULL AS [grandfather_price],
@html.extend('layout', function(model){
@html.block('content', function(model){
<h2>@model.channel</h2>
<table class="table table-bordered">
@model.buffer.forEach(function(msg){
<tr>
<td>
@cdeutsch
cdeutsch / gist:9712308
Created March 22, 2014 18:49
Scrape Google Site List
function md5cycle(x, k) {
var a = x[0], b = x[1], c = x[2], d = x[3];
a = ff(a, b, c, d, k[0], 7, -680876936);
d = ff(d, a, b, c, k[1], 12, -389564586);
c = ff(c, d, a, b, k[2], 17, 606105819);
b = ff(b, c, d, a, k[3], 22, -1044525330);
a = ff(a, b, c, d, k[4], 7, -176418897);
d = ff(d, a, b, c, k[5], 12, 1200080426);