This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// PZIAdapter.cpp : Defines the exported functions for the DLL application. | |
// | |
#include "stdafx.h" | |
#include "PZIAdapter.h" | |
// This is an example of an exported function. | |
PZIADAPTER_API DWORD _stdcall StripFilePZI(BSTR bstrFilename) | |
{ | |
if(!bstrFilename){return E_INVALIDARG;} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
REM If PowerShell 2 is not installed, this script will automatically download and install it. | |
REM Only works on XP SP3 with .NET 3.5. Only for dev boxes, not designed for servers. | |
REM Based on http://blog.codeassassin.com/2009/12/10/no-web-browser-need-powershell/ | |
ver | find "XP" > nul | |
if %ERRORLEVEL% neq 0 goto not_xp | |
ver | find "5.1.2600" > nul |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Reflects the requests from HTTP methods GET, POST, PUT, and DELETE | |
# Written by Nathan Hamiel (2010) | |
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler | |
from optparse import OptionParser | |
class RequestHandler(BaseHTTPRequestHandler): | |
def do_GET(self): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Array.prototype.selectMany = function (fn) { | |
return this.map(fn).reduce(function (x, y) { return x.concat(y); }, []); | |
}; | |
// usage | |
console.log([[1,2,3], [4,5,6]].selectMany(function (x) { return x; })); //[1,2,3,4,5,6] | |
console.log([{ a: [1,2,3] }, { a: [4,5,6] }].selectMany(function (x) { return x.a; })); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var localPath = "Some Path"; | |
if (!Workstation.Current.IsMapped(localPath)) { | |
Log.LogError(string.Format("The local path '{0}' is not mapped to a TFS workspace.", LocalPath)); | |
return false; | |
} | |
var info = Workstation.Current.GetLocalWorkspaceInfo(localPath); | |
var collection = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(info.ServerUri); | |
var workspace = info.GetWorkspace(collection); | |
var localVersions = workspace.GetLocalVersions(new [] {new ItemSpec(localPath, RecursionType.Full)}, false); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#requires -Version 2.0 | |
param( | |
[Parameter(Mandatory=$true)] | |
[string] | |
$databaseRootDirectory | |
) | |
$ErrorActionPreference = 'Stop' | |
Set-StrictMode -Version 'Latest' | |
$fileGroupSpecification = "ON [PRIMARY]" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get rid of color codes | |
mutate { | |
gsub => ["message", "\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]", ""] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import os | |
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project.settings") | |
import newrelic.agent | |
newrelic.agent.initialize(os.path.join(os.path.dirname(os.path.dirname(__file__), 'newrelic.ini') | |
from django.core.wsgi import get_wsgi_application | |
application = get_wsgi_application() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# https://gist.github.com/robwierzbowski/5430952/ | |
# Create and push to a new github repo from the command line. | |
# Grabs sensible defaults from the containing folder and `.gitconfig`. | |
# Refinements welcome. | |
# Gather constant vars | |
CURRENTDIR=${PWD##*/} | |
GITHUBUSER=$(git config github.user) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
def archive_to_bytes(archive): | |
def to_seconds(s): | |
SECONDS_IN_A = { | |
's': 1, | |
'm': 1 * 60, | |
'h': 1 * 60 * 60, |
OlderNewer