Skip to content

Instantly share code, notes, and snippets.

View derekgates's full-sized avatar

Derek Gates derekgates

View GitHub Profile
@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;
@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 {
@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"
@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']"
@yantonov
yantonov / hg2git.sh
Last active March 25, 2016 05:32
Creates git repo from mercurial repo using fast-export tool
#/bin/bash
# script creates git repo from hg (mercurial) repo using fast-export tool
tempDirectory="tmp-"`date +%s`
function get_working_directory_path() {
echo "/tmp/$tempDirectory"
}
@madrobby
madrobby / gist:4161897
Created November 28, 2012 15:16
Retina screen media query
@media (min--moz-device-pixel-ratio: 1.5),
(-o-min-device-pixel-ratio: 3/2),
(-webkit-min-device-pixel-ratio: 1.5),
(min-device-pixel-ratio: 1.5),
(min-resolution: 144dpi),
(min-resolution: 1.5dppx) {
/* Retina rules! */
}

Snow in canvas land

Other people's code is awful, and your own code from months previous counts as someone else's. With this and the festive spirit in mind, I dug up a canvas snow demo I made two years ago to see how bad my code really was.

Turns out the performance landscape has changed quite a bit, but after applying a couple of workarounds, best practices, and memory management, I got the demo running smoother than it ever did.

Ugh, I can't believe I just wrote "performance landscape". Anyway...

How does the demo work?

@mmooney
mmooney / deploy.ps1
Last active December 11, 2015 03:39 — forked from srkirkland/deploy.ps1
#Modified and simplified version of https://www.windowsazure.com/en-us/develop/net/common-tasks/continuous-delivery/
#From: #https://gist.github.com/3694398
$subscription = "[SubscriptionName]" #this the name from your .publishsettings file
$service = "[ServiceName]" #this is the name of the cloud service
$storageAccount = "[StorageAccountName]" #this is the name of the storage service
$slot = "production" #staging or production
$package = "[Fully Qualified Path to .cspkg]"
$configuration = "[Fully Qualified path to .cscfg]"
$publishSettingsFile = "[Path to .publishsettings file, relative is OK]"
$timeStampFormat = "g"
@dotMorten
dotMorten / HttpGZipClientHandler.cs
Last active May 8, 2018 19:38
GZip support for PCL HttpClient. Create HttpClient using: HttpClient client = new HttpClient(new HttpGZipClientHandler());
using System.IO;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading;
using System.Threading.Tasks;
namespace SharpGIS.Http
{
public class HttpGZipClientHandler : HttpClientHandler
{
@aras-p
aras-p / gist:5088284
Last active December 14, 2015 12:39
GfxDevice source sizes
Platform specific GfxDevice implementation source code size in Unity:
Direct3D 9 342k
Direct3D 11 446k, 146k of which fixed function emulation ;)
Flash Stage3D 147k
OpenGL 303k
OpenGL ES 1.1 140k
OpenGL ES 2.0 308k
PS3 libGCM 279k
Xbox 360 225k