Skip to content

Instantly share code, notes, and snippets.

View ninnemana's full-sized avatar
🏠

Alex Ninneman ninnemana

🏠
View GitHub Profile
@ninnemana
ninnemana / parallel.cs
Created September 14, 2012 19:53
Parallel.ForEach
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
using System.Web.Http;
using API.Models;
using System.Diagnostics;
@ninnemana
ninnemana / ImageHelper.java
Created September 19, 2012 15:48
Rounded Corners in Android
package com.curt.images;
import android.graphics.Bitmap;
import android.graphics.Bitmap.Config;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.PorterDuff.Mode;
import android.graphics.PorterDuffXfermode;
import android.graphics.Rect;
import android.graphics.RectF;
@ninnemana
ninnemana / Request.xml
Created October 1, 2012 17:29
Polk Request
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://webservice.vindecoder.polk.com/">
<soapenv:Header/>
<soapenv:Body>
<web:decodeVin>
<VinRequest>
<vin>1FAHP2FW5AG100583</vin>
</VinRequest>
<RequestedFields>MDL_YR,MAK_NM,MDL_DESC,ACES_VEHICLE_ID,ACES_BASE_VEHICLE</RequestedFields>
</web:decodeVin>
</soapenv:Body>
@ninnemana
ninnemana / Response.xml
Created October 1, 2012 17:31
Polk Response
<?xml version='1.0' encoding='UTF-8'?>
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<ns2:decodeVinResponse xmlns:ns2="http://webservice.vindecoder.polk.com/">
<VinResponse>
<vin>1FAHP2FW5AG100583</vin>
<returnCode>0</returnCode>
<correctedVin></correctedVin>
<errorBytes> </errorBytes>
<fields name="MAK_NM">FORD</fields>
@ninnemana
ninnemana / GetModel.cs
Created October 15, 2012 15:23
GetModel
return (from mo in db.vcdb_Models
join bv in db.BaseVehicles on mo.ID equals bv.MakeID
join v in db.vcdb_Vehicles on bv.ID equals v.BaseVehicleID
join vp in db.vcdb_VehicleParts on v.ID equals vp.VehicleID
join ma in db.vcdb_Makes on bv.MakeID equals ma.ID
where bv.YearID.Equals(year.Year) && ma.MakeName.Equals(make.Make)
select new VehicleModel {
Model = mo.ModelName
}).Distinct().OrderBy(x => x.Model).ToList();
@ninnemana
ninnemana / nginx.conf
Created November 7, 2012 03:06
nginx config file
server {
listen 80; ## listen for ipv4; this line is default and implied
#listen [::]:80 default ipv6only=on; ## listen for ipv6
access_log logs/localhost.access.log;
# Make site accessible from http://localhost/
server_name ninnemana.xen.prgmr.com;
index index.html;
package code
import org.squeryl._
import org.squeryl.adapters.MSSQLServer
import org.squeryl.PrimitiveTypeMode._
object Main {
def main(args: Array[String]) {
use CurtDev
create table ApiKeyType(
id uniqueidentifier default(newid()) primary key not null,
type varchar(500),
date_added datetime default(GETDATE()) not null
)
go
create table ApiModules(
@ninnemana
ninnemana / ajax.js
Last active December 10, 2015 12:59
$.support.cors = true;
var req = $.ajax({
url: 'http://api.example.com',
type: 'GET',
dataType: 'json',
data: {},
beforeSend: function(xhr,settings){
},
success: function(resp, textStatus, xhr){
package controllers
import (
"gophers/plate"
"html/template"
"net/http"
"time"
)
func Index(w http.ResponseWriter, r *http.Request) {