Skip to content

Instantly share code, notes, and snippets.

View kylewest's full-sized avatar

Kyle West kylewest

View GitHub Profile
using System.Net;
using System.Net.Mail;
namespace Client.Project.Messaging
{
/// <summary>
/// Provides a message object that sends the email through gmail.
/// MailgunMessage is inherited from <c>System.Web.Mail.MailMessage</c>, so all the mail message features are available.
/// </summary>
public class MailgunMessage : MailMessage
select StartYear
, EndYear
, Make
, Model
, COUNT(f.Id) as [FitmentCount]
from ItmFitments f join ItmItems i on f.ItemId = i.Id
JOIN ItmGroups g on i.GroupId = g.Id
JOIN ItmBrands b on g.BrandId = b.Id
where Make != 'UNIVERSAL'
AND Make != 'NON-US VEHICLE'
@kylewest
kylewest / ene.xml
Created January 26, 2012 19:02
pies
<Item MaintenanceType="C">
<HazardousMaterialCode>X</HazardousMaterialCode>
<ItemLevelGTIN GTINQualifier="UP">703639239055</ItemLevelGTIN>
<PartNumber>1.2101G</PartNumber>
<BrandAAIAID>BDVQ</BrandAAIAID>
<BrandLabel>Energy Suspension</BrandLabel>
<PartTerminologyID>7488</PartTerminologyID>
<Descriptions>
<Description MaintenanceType="C" DescriptionCode="DES" LanguageCode="EN">Leaf Spring Bushing Set</Description>
<Description MaintenanceType="C" DescriptionCode="SHO" LanguageCode="EN">LeafSpBsh</Description>
@kylewest
kylewest / trystack.markdown
Created February 22, 2012 18:27
TryStack in 8 Simple Steps

TryStack in 8 Simple Steps

  1. Head over to trystack.org then join the facebook group to get your invite.
  2. When you get the (Somebody) approved your request to join the group TryStack notification, go login to trystack (click login using facebook and approve with facebook).
  3. Click the Security Groups tab, click Edit Rules, and add a couple rules:
    1. icmp, from port: -1, to port: -1, cidr: 0.0.0.0/0
    2. tcp, from port: 22, to port: 22, cidr: your.ip.address.here/32
  4. Click the Keypairs tab, then click Add New Keypair, name it trystack. A file will download to your computer.
  5. Click the Images tab, then click Launch next to one of the images. Fill out the form and make sure to select trystack as your Key Name and include default in the Security Groups. Click launch instance. Note the IP address you are assigned.
#!/usr/bin/perl
#---------
# LogglySender v0.1
# Sends log lines from Apache to Loggly via an HTTP input
# http://wiki.loggly.com/
#---------
# IMPORTANT: Be sure to make this script executable!
# (e.g. "chmod +x logglysender.pl")
#---------
var sb = new StringBuilder();
sb.AppendLine(string.Format("<strong>{0} ({1})</strong>", ItmGroup.Name, PartNumber));
if (!string.IsNullOrEmpty(Notes))
{
sb.AppendLine(string.Format("<div class=\"order_item_notes\">{0}</div>", Notes.Replace(";","<br/>")));
}
if (ItmItemSpecs.Count != 0)
{
sb.AppendLine("<div class=\"order_item_specs\">");
foreach (ItmItemSpec spec in ItmItemSpecs)
@kylewest
kylewest / rejoiner.html
Created May 16, 2012 14:03
rejoiner.html
<script type="text/javascript">
if (window.location.pathname.toLowerCase() == '/wherever/this/is/supposed/to/go') {
var html_doc = document.getElementsByTagName('head').item(0);
var js = document.createElement('script');
js.setAttribute('language', 'javascript');
js.setAttribute('type', 'text/javascript');
js.setAttribute('src', 'https://app.rejoiner.com/app/sites/4f3daa0418484d06b50001e3/rj-convert.js');
html_doc.appendChild(js);
}
</script>

Changes to Shipping Adjustments

Shipping Adjustments allow you to change the shipping rates displayed for a particular Brand, Product Group, or Item.

The Old Way

Shipping Adjustments were applied to all available shipping methods. For example, if you enable UPS Ground and UPS Next Day Air and define a 100% shipping discount, both UPS Ground and UPS Next Day Air would calculate to $0.00.

The New Way

Cobook + Alfred + Google Contacts

Cobook is "the smart address book" -- it sits in your dock, awoken by a keyboard shortcut, ready to serch your contacts, and display not only the information you've stored about them, but also their social profiles, etc. It also makes it dead simple to create, update, tag, email, tweet, yada, yada.

Alfred is the best thing since OSX for the Mac. Among a-million other things it allows you to search and view your contacts.

Google Contacts Sync

Until a few days ago, when Cobook released Google Contacts support, I used the standard Synchronize with Google feature in Address Book. It worked OK, but I think there are some discrepancies in how individual fields are synced (e.g. Work Phone becomes Other). I figured Cobook could do a better job so decided to give them a shot.

..='cd ..'
...=../..
....=../../..
.....=../../../..
1='cd +1'
2='cd +2'
3='cd +3'
4='cd +4'
5='cd +5'
6='cd +6'