Skip to content

Instantly share code, notes, and snippets.

View derekgates's full-sized avatar

Derek Gates derekgates

View GitHub Profile
@StevenMcD
StevenMcD / TeamCity_helperFunctions.ps1
Created November 3, 2012 20:20
TeamCity - Powershell Helper functions
#############################
# Mercilessly copied from https://github.com/kvarv/Continuous-Delivery
#############################
function TeamCity-TestSuiteStarted([string]$name) {
Write-Output "##teamcity[testSuiteStarted name='$name']"
}
function TeamCity-TestSuiteFinished([string]$name) {
Write-Output "##teamcity[testSuiteFinished name='$name']"
@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"
@theconektd
theconektd / github.css
Created April 30, 2012 02:11
Github Markdown CSS - for Markdown Editor Preview
body {
font-family: Helvetica, arial, sans-serif;
font-size: 14px;
line-height: 1.6;
padding-top: 10px;
padding-bottom: 10px;
background-color: white;
padding: 30px; }
body > *:first-child {
@markheath
markheath / XhtmlToMarkdownConverter.cs
Created February 15, 2012 19:07
Convert XLST to Markdown with C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.XPath;
using System.Xml.Xsl;
using System.IO;
using System.Reflection;
using System.Xml;
@benfoxall
benfoxall / gist:1753574
Created February 6, 2012 17:40
A function for converting .NET dates in json responses
/*!
* $.convertJSONDates
*
* $.getJSON(…).pipe($.convertJSONDates).done(function(data){…})
*
* Based on …
*
* jQuery.parseJSON()
* http://erraticdev.blogspot.com/2010/12/converting-dates-in-json-strings-using.html
*
@drlongnecker
drlongnecker / SendTo-Campfire.ps1
Created January 16, 2012 18:55
Posting to Campfire from PowerShell
param (
[string]$RoomNumber = (Read-Host "The room to post to (default: 123456) "),
[string]$Message = (Read-Host "The message to send ")
)
$defaultRoom = "123456"
if ($RoomNumber -eq "") {
$RoomNumber = $defaultRoom
}
$authToken = "YOUR AUTH TOKEN"
@TaoK
TaoK / Invoke-ElevatedCommand.ps1
Created January 9, 2012 09:33
Invoke-ElevatedCommand for Administrator-level commands in a common powershell pipeline
Function Invoke-ElevatedCommand {
<#
.DESCRIPTION
Invokes the provided script block in a new elevated (Administrator) powershell process,
while retaining access to the pipeline (pipe in and out). Please note, "Write-Host" output
will be LOST - only the object pipeline and errors are handled. In general, prefer
"Write-Output" over "Write-Host" unless UI output is the only possible use of the information.
Also see Community Extensions "Invoke-Elevated"/"su"
.EXAMPLE
@paulirish
paulirish / rAF.js
Last active April 17, 2025 15:06
requestAnimationFrame polyfill
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel
// MIT license
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];
@drlongnecker
drlongnecker / FindTODO.ps1
Created December 27, 2011 16:52
Finding TODOs and Reporting in PowerShell
#full details now available: http://tiredblogger.wordpress.com/2011/12/28/finding-todos-and-reporting-in-powershell/
param(
#this is appalling; there has to be a better way to get the raw name of "this" directory.
[string]$DirectoryMask = (get-location),
[array]$Include =
@("*.spark","*.cs","*.js","*.coffee","*.rb"),
[array]$Exclude =
@("fubu-content","packages","build","release"),
[switch]$Html,
@mathewbyrne
mathewbyrne / slugify.js
Created October 12, 2011 04:34
Javascript Slugify
function slugify(text)
{
return text.toString().toLowerCase()
.replace(/\s+/g, '-') // Replace spaces with -
.replace(/[^\w\-]+/g, '') // Remove all non-word chars
.replace(/\-\-+/g, '-') // Replace multiple - with single -
.replace(/^-+/, '') // Trim - from start of text
.replace(/-+$/, ''); // Trim - from end of text
}