Skip to content

Instantly share code, notes, and snippets.

@stevensk
stevensk / azure_web_config_transforms
Last active September 23, 2017 18:16
Azure Web.config Transforms & Continuous Deployment
// Scenario
We've got two Azure web sites (Staging and Production), each with their respective database and we want to deploy to both websites from the same Git repository using continuous deployment. We need to take advantage of config transforms to accommodate the differences between the two environments, such as connection strings, for example.
Continuous deployment is fairly straight-forward, as we can simply specify different branches for each enivronment. For example, using GitFlow, we can use the "develop" branch to deploy to our Acceptance or Staging environment and our "master" branch to deploy to our Production environment. This allows us to use Pull Requests as an approval workflow for automated contiuous deployment.
// Setup
1) To enable config transforms for a web application project, simply add a transform for each environment required, in this case "Staging":
@jonmaim
jonmaim / qs.js
Created December 8, 2012 10:51
Generate query string for angular.js
/* Converts an object into a key/value par with an optional prefix. Used for converting objects to a query string */
var qs = function(obj, prefix){
var str = [];
for (var p in obj) {
var k = prefix ? prefix + "[" + p + "]" : p,
v = obj[k];
str.push(angular.isObject(v) ? qs(v, k) : (k) + "=" + encodeURIComponent(v));
}
return str.join("&");
}
@kurtpayne
kurtpayne / web.config
Created June 13, 2012 00:16
web.config with caching and compression
<?xml version="1.0" encoding="UTF-8"?>
<!-- web.config contributed to html5boilerplate by Velir : velir.com -->
<configuration>
<system.webServer>
<httpCompression directory="%SystemDrive%\websites\_compressed" minFileSizeForComp="1024">
<scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll" />
<staticTypes>
<add mimeType="text/*" enabled="true" />
<add mimeType="message/*" enabled="true" />
<add mimeType="application/javascript" enabled="true" />
@baldowl
baldowl / import.rb
Created January 8, 2012 16:41 — forked from juniorz/import.rb
Import a blogger archive to jekyll (octopress version)
require 'rubygems'
require 'nokogiri'
require 'fileutils'
require 'date'
require 'uri'
# usage: ruby import.rb my-blog.xml
# my-blog.xml is a file from Settings -> Basic -> Export in blogger.
data = File.read ARGV[0]