Skip to content

Instantly share code, notes, and snippets.

View kthompson's full-sized avatar
😀

Kevin Thompson kthompson

😀
View GitHub Profile
@koenbollen
koenbollen / Screen.cs
Created April 18, 2011 14:43
A simple but complete ScreenManager for XNA.
using Microsoft.Xna.Framework;
using System.Linq;
namespace Screens
{
/// <summary>
/// This is a screen that can be added to the ScreenManager. Extend it and add components
/// to it in the Initialize() method. You can also override the Update() and Draw() method.
/// </summary>
@AnsonT
AnsonT / gist:1115264
Created July 30, 2011 06:32
CoffeeScript debugging with node-inspector
node-inspector &
coffee --nodejs --debug app.coffee &
google-chrome http://127.0.0.1:8080/debug?port=5858 &
google-chrome http://127.0.0.1:3000 &
@jnx
jnx / rbenv-install-system-wide.sh
Created October 1, 2011 20:09
rbenv install and system wide install on Ubuntu 10.04 LTS.
# Update, upgrade and install development tools:
apt-get update
apt-get -y upgrade
apt-get -y install build-essential
apt-get -y install git-core
# Install rbenv
git clone git://github.com/sstephenson/rbenv.git /usr/local/rbenv
# Add rbenv to the path:
@kthompson
kthompson / cmds.txt
Created March 8, 2012 23:27
How to configure P4Merge for git.
git config --global mergetool.p4merge.path /c/Program\ Files/Perforce/p4merge.exe
public static class XmlHelper
{
public const string DefaultParseElementName = "@default";
public static void ParseXml(XmlReader reader, Dictionary<string, Action> actions, string endElement = null)
{
// If no end element was specified then just read until the end tag of our current element
if (string.IsNullOrEmpty(endElement))
{
@kthompson
kthompson / choco_basic.cmd
Last active December 28, 2015 19:28
Basic windows install.
:: install Chocolatey
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin
:: basics
choco install 7zip GoogleChrome vlc adobereader SublimeText3 putty
:: dev
choco install VisualStudio2013Premium -InstallArguments "/Features:'WebTools Win8SDK'
@hopsoft
hopsoft / db.rake
Last active September 17, 2024 06:23
Rails rake tasks for dump & restore of PostgreSQL databases
# lib/tasks/db.rake
namespace :db do
desc "Dumps the database to db/APP_NAME.dump"
task :dump => :environment do
cmd = nil
with_config do |app, host, db, user|
cmd = "pg_dump --host #{host} --username #{user} --verbose --clean --no-owner --no-acl --format=c #{db} > #{Rails.root}/db/#{app}.dump"
end
puts cmd
@epetrie
epetrie / ReflectionExtensions.cs
Last active August 29, 2015 14:21
Reflection / Compiled Lambda Extensions
public static class Reflection
{
public static ConstructorInfo GetDefaultConstructor(this Type type)
{
return type.GetConstructor(Type.EmptyTypes);
}
public static T CreateInstance<T>(this Type type, params object[] args) where T : class
{
return CreateInstance(type, args) as T;
@davidfowl
davidfowl / Example1.cs
Last active September 2, 2024 12:36
How .NET Standard relates to .NET Platforms
namespace Analogy
{
/// <summary>
/// This example shows that a library that needs access to target .NET Standard 1.3
/// can only access APIs available in that .NET Standard. Even though similar the APIs exist on .NET
/// Framework 4.5, it implements a version of .NET Standard that isn't compatible with the library.
/// </summary>INetCoreApp10
class Example1
{
public void Net45Application(INetFramework45 platform)
@kthompson
kthompson / Lulzbot TAZ 5 (0.5 nozzle).fff
Created March 1, 2017 03:44
Simplify3D settings for Lulzbot TAZ 5 w/ 0.5mm nozzle
<?xml version="1.0"?>
<profile name="Lulzbot TAZ 5 (0.5 nozzle)" version="2017-02-28 19:41:52" app="S3D-Software 3.1.1">
<baseProfile>LulzBot TAZ 5 Dual Extruder (0.5mm nozzle) (modified)</baseProfile>
<printMaterial>ABS Red</printMaterial>
<printQuality>Medium</printQuality>
<printExtruders>Default</printExtruders>
<extruder name="Extruder">
<toolheadNumber>0</toolheadNumber>
<diameter>0.5</diameter>
<autoWidth>1</autoWidth>