Skip to content

Instantly share code, notes, and snippets.

@kogakure
kogakure / gist:205825
Created October 9, 2009 07:28
Bash: Git – Rename an email address in all old commits.
# Rename an email address in all old commits.
# WARNING: Will change all your commit SHA1s.
# Based off of the script from here:
# http://coffee.geek.nz/how-change-author-git.html
git filter-branch -f --commit-filter '
if [ "$GIT_COMMITTER_EMAIL" = "joern.zaefferer@googlemail.com" ];
then
GIT_AUTHOR_EMAIL="joern.zaefferer@gmail.com";
GIT_COMMITTER_EMAIL="joern.zaefferer@gmail.com";
git commit-tree "$@";
using System.Collections.Generic;
using MongoDB.Driver;
namespace DynoMongo
{
public class DynoCollection
{
private IMongoCollection _col;
public DynoCollection(IMongoCollection col)
@rdp
rdp / gist:519744
Created August 11, 2010 20:54
rake fails until you delete the original .gemspec file
C:\installs\trunk3_installed>cd bin
C:\installs\trunk3_installed\bin>rake -T
C:/installs/trunk3_installed/lib/ruby/1.9.1/rubygems.rb:340:in `bin_path': can't find executable rake for rake-0.8.7 (Gem::Exception)
from C:/installs/trunk3_installed/bin/rake:19:in `<main>'
C:\installs\trunk3_installed\bin>cd ..
C:\installs\trunk3_installed>cat ./lib/ruby/gems/1.9.1/specifications/rake.gemspec
Gem::Specification.new do |s|
@arnold-almeida
arnold-almeida / symlinks->hardlinks
Created October 10, 2010 12:08
Convert symlinks to hard links in a dir
@stevenharman
stevenharman / Iso8601DateTimeBinder.cs
Created November 2, 2010 19:25
an asp.net-mvc Model Binder that respects the ISO 8601 standard. look it up, yo!
using System;
using System.Globalization;
using System.Web.Mvc;
namespace Zomg.Web.ModelBinders
{
public class Iso8601DateTimeBinder : DefaultModelBinder
{
public override object BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext)
{
@mxriverlynn
mxriverlynn / .bashrc
Created November 25, 2010 17:08
.bashrc for MSysGit's "Git Bash Shell" (MinGW32 shell) with Pik
pik_info() {
version= pik info | awk '/full_version/ {print $2,$3}' | sed 's/\"//;s/\s/\-/'
printf "${version}"
}
function prompt {
local LIGHT_RED="\[\033[1;31m\]"
local LIGHT_GREEN="\[\033[1;32m\]"
local NO_COLOUR="\[\033[0m\]"
@prabirshrestha
prabirshrestha / iso8601Datetime.cs
Created April 5, 2011 16:43
ISO8601 Date Time helpers
public static class DateTimeHelpers
{
private static readonly string[] Iso8601Format = new[]
{
"yyyy'-'MM'-'dd'T'HH':'mm':'ss'Z'",
@"yyyy-MM-dd\THH:mm:ssK"
};
//SortableDateTimePattern (ISO 8601)
public static string ToIso8601(DateTime value)
@jonah-williams
jonah-williams / build.sh
Created April 30, 2011 17:46
Command line iOS project builds and over-the-air distribution
#!/bin/bash
# https://gist.github.com/949831
# http://blog.carbonfive.com/2011/05/04/automated-ad-hoc-builds-using-xcode-4/
# command line OTA distribution references and examples
# http://nachbaur.com/blog/how-to-automate-your-iphone-app-builds-with-hudson
# http://nachbaur.com/blog/building-ios-apps-for-over-the-air-adhoc-distribution
# http://blog.octo.com/en/automating-over-the-air-deployment-for-iphone/
# http://www.neat.io/posts/2010/10/27/automated-ota-ios-app-distribution.html
using System.Web;
namespace NetflixDemo
{
public class AppHarborHttpContextWrapper : HttpContextWrapper
{
private readonly HttpContext httpContext;
public AppHarborHttpContextWrapper(HttpContext httpContext) : base(httpContext)
{
@jgable
jgable / Enum_RadioButtonList.cshtml
Created May 15, 2011 20:02
A helper for showing a RadioButton List in .Net MVC 3
@model Enum
@{
// Looks for a [Display(Name="Some Name")] Attribute on your enum
Func<Enum, string> getDescription = en =>
{
Type type = en.GetType();
System.Reflection.MemberInfo[] memInfo = type.GetMember(en.ToString());
if (memInfo != null && memInfo.Length > 0)