Skip to content

Instantly share code, notes, and snippets.

View ctolkien's full-sized avatar
👋

Chad Tolkien ctolkien

👋
View GitHub Profile
<script>
// (c) Copyright 2016 Caroline Schnapp. All Rights Reserved. Contact: mllegeorgesand@gmail.com
// See https://docs.shopify.com/themes/customization/navigation/link-product-options-in-menus
var Shopify = Shopify || {};
Shopify.optionsMap = {};
Shopify.updateOptionsInSelector = function(selectorIndex) {
@liamcurry
liamcurry / gist:2597326
Created May 4, 2012 19:56
Vanilla JS vs jQuery

Moving from jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
[AttributeUsage(System.AttributeTargets.All, AllowMultiple = true, Inherited = true)]
public class ಠ_ಠAttribute : Attribute
{
public ILog Log { get; set; }
public ಠ_ಠAttribute()
{
Log.Info("This code is bad and you should feel bad");
}
}
@jculverwell
jculverwell / migration.sql
Created September 1, 2012 19:50
Migration from ASP.NET Membership to SimpleMembership
--This script attempts to migrate the users
--from the old ASP.Net Membership tables
--into the new SimpleMemberShip tables
--The SimpleMembsership uses more secure password hashing, as such the old password hashes won't
--work with the SimpleMembership tables.
--As far as I can tell you have two options
--1) Get your users to reset their passwords
--2) Update your web.config to force SimpleMembership to use the old SHA1 format. See more details
--here http://stackoverflow.com/questions/12236533/migrating-from-asp-net-membership-to-simplemembership-in-mvc4-rtm
@srkirkland
srkirkland / deploy.ps1
Created September 10, 2012 22:18
TeamCity CI Deploy Azure PowerShell Script
#Modified and simplified version of https://www.windowsazure.com/en-us/develop/net/common-tasks/continuous-delivery/
$subscription = "[Your Subscription Name]"
$service = "[Your Azure Service Name]"
$slot = "staging" #staging or production
$package = "[ProjectName]\bin\[BuildConfigName]\app.publish\[ProjectName].cspkg"
$configuration = "[ProjectName]\bin\[BuildConfigName]\app.publish\ServiceConfiguration.Cloud.cscfg"
$timeStampFormat = "g"
$deploymentLabel = "ContinuousDeploy to $service v%build.number%"
Write-Output "Running Azure Imports"
@haf
haf / install-mono.sh
Created September 13, 2012 09:10
Installing Mono 2.10.8 + MonoDevelop 3 + F# 2.0 in ubuntu 12.04
#!/bin/sh
# change this to the version that you want to install
# in order for this script to work, the version has to
# exist as a tag or branch on git as "monodevelop-$MD_VER"
MD_VER=3.0.3.5
# the branch/tag that we will checkout to build and install
MD=monodevelop-$MD_VER
@benfoster
benfoster / gist:3924025
Created October 20, 2012 17:00
LESS CSS Support in System.Web.Optimization
public class LessTransform : IBundleTransform
{
public void Process(BundleContext context, BundleResponse bundle)
{
if (context == null)
{
throw new ArgumentNullException("context");
}
if (bundle == null)
@yngvebn
yngvebn / gist:8347809
Created January 10, 2014 06:31
Workaround for invalid Media Query minification (WebGrease and System.Web.Optimization)
public class BundleConfig
{
public static void RegisterBundles(BundleCollection bundles)
{
var siteCssBundle = new StyleBundle("~/css/site").IncludeDirectory("~/public/css", "*.css");
siteCssBundle.Transforms.Clear();
siteCssBundle.Transforms.Add(new CustomCssMinify());
bundles.Add(siteCssBundle);
}
}
@ctolkien
ctolkien / gist:8487470
Created January 18, 2014 07:39
Simple Injector - sample MVC and WebAPI Wireup.
public class DependencyConfig
{
public static void RegisterDependencies(HttpConfiguration httpConfiguration)
{
var container = new SimpleInjector.Container();
System.Web.Mvc.DependencyResolver.SetResolver(new SimpleInjectorDependencyResolver(container));
@codingoutloud
codingoutloud / azuremap.geojson
Last active November 15, 2016 04:24
AzureMap map model files -- generated in GeoJSON and TopoJSON formats -- blogged about here: http://blog.codingoutloud.com/2014/02/01/mapping-windows-azure-4-years-after-full-general-availability/
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.