Skip to content

Instantly share code, notes, and snippets.

View jkriddle's full-sized avatar

Joshua Riddle jkriddle

  • Baltimore, MD
View GitHub Profile
@jkriddle
jkriddle / SiteBackup.cs
Created September 5, 2012 20:02
Backup a set of site files using MSDeploy
var keyName = @"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\IIS Extensions\MSDeploy\2";
const string valueName = "InstallPath";
var kVal = Registry.GetValue(keyName, valueName, "").ToString();
if (string.IsNullOrEmpty(kVal))
{
keyName = @"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\IIS Extensions\MSDeploy\1";
kVal = Registry.GetValue(keyName, valueName, "").ToString();
}
if (string.IsNullOrEmpty(kVal)) return;
var targetName = Environment.MachineName;
@jkriddle
jkriddle / bootstrap.css
Created January 10, 2013 19:24
UPDATED for v3.0.3: https://gist.github.com/jkriddle/8437778 -- A compiled version of Twitter Bootstrap v2.2.2 using a CSS namespace of .tbs. For anyone wanting to use Twitter Bootstrap in an existing project without affecting existing styles, and don't have .less support. To use: apply the class .tbs to a wrapper element where you want to use T…
/*!
* Bootstrap v2.2.2
*
* Copyright 2012 Twitter, Inc
* Licensed under the Apache License v2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Designed and built with all the love in the world @twitter by @mdo and @fat.
*/
.tbs article,
@jkriddle
jkriddle / legend.js
Created January 23, 2013 03:11
Working snipped
var l = new LegendApp;
if(window.FB)
{
facebookInit();
}
else
{
window.fbAsyncInit = facebookInit;
}
@jkriddle
jkriddle / gist:5056652
Created February 28, 2013 13:19
query
/****** Object: StoredProcedure [dbo].[sp_GetRecommendedProducts] Script Date: 02/27/2013 11:40:55 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[sp_GetRecommendedProducts]
-- Add the parameters for the stored procedure here
@productID int
@jkriddle
jkriddle / convert-states.sql
Created March 20, 2013 13:48
SQL update script to convert state names to ISO 3166-2 codes. Just rename the table/field names as needed.
UPDATE USER_INFO SET STATE='AL' WHERE STATE='Alabama';
UPDATE USER_INFO SET STATE='AK' WHERE STATE='Alaska';
UPDATE USER_INFO SET STATE='AZ' WHERE STATE='Arizona';
UPDATE USER_INFO SET STATE='AR' WHERE STATE='Arkansas';
UPDATE USER_INFO SET STATE='CA' WHERE STATE='California';
UPDATE USER_INFO SET STATE='CO' WHERE STATE='Colorado';
UPDATE USER_INFO SET STATE='CT' WHERE STATE='Connecticut';
UPDATE USER_INFO SET STATE='DE' WHERE STATE='Delaware';
UPDATE USER_INFO SET STATE='DC' WHERE STATE='District of Columbia';
UPDATE USER_INFO SET STATE='FL' WHERE STATE='Florida';
@jkriddle
jkriddle / InvisibleShadowCaster.shader
Created March 29, 2013 03:17
Unity3D shader that will make an object transparent, but still cast shadows.
Shader "Transparent/InvisibleShadowCaster"
{
Subshader
{
UsePass "VertexLit/SHADOWCOLLECTOR"
UsePass "VertexLit/SHADOWCASTER"
}
Fallback off
}
new-host:~ mac$ ab -n 100 -c 10 http://escapefromhell.theriddlebrothers.net/api/section/get
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking escapefromhell.theriddlebrothers.net (be patient).....done
Server Software: Apache/2.2.22
Server Hostname: escapefromhell.theriddlebrothers.net
new-host:~ mac$ ab -n 100 -c 10 http://staging.beargrylls.discoveryuk.com/api/section/get
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking staging.beargrylls.discoveryuk.com (be patient).....done
Server Software: Apache
Server Hostname: staging.beargrylls.discoveryuk.com
Macs-MacBook-Pro:~ mac$ ab -n 100 -c 10 http://staging.beargrylls.discoveryuk.com/api/section/get
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking staging.beargrylls.discoveryuk.com (be patient).....done
Server Software: Apache
Server Hostname: staging.beargrylls.discoveryuk.com
oncurrency Level: 100
Time taken for tests: 20.205 seconds
Complete requests: 455
Failed requests: 238
(Connect: 0, Receive: 0, Length: 238, Exceptions: 0)
Write errors: 0
Non-2xx responses: 455
Total transferred: 399588 bytes
HTML transferred: 151452 bytes
Requests per second: 22.52 [#/sec] (mean)