Skip to content

Instantly share code, notes, and snippets.

View timabell's full-sized avatar
🍵
418 I'm a teapot

Tim Abell timabell

🍵
418 I'm a teapot
View GitHub Profile
@timabell
timabell / git-many
Last active June 21, 2021 16:18
deal with multiple git repositories
#!/bin/bash
# refs http://tim.theenchanter.com/2008/06/garbage-collect-every-git-repository-on.html
# This script hosted at https://gist.github.com/1391205
echo "Searching..."
find -L . -maxdepth 3 -type d -name .git | while read dir;
do
pushd "$dir" > /dev/null
cd ..
@timabell
timabell / gist:1472575
Created December 13, 2011 15:40
resize with imagemagick
ls *.jpg | xargs -l -i convert -resize 1024x1024 -quality 50% -verbose {} small/{}
@timabell
timabell / PageDataExtensions.cs
Created March 26, 2012 14:37
PageDataExtensions for making it easier to work with EpiServer 6.1 pages
using System;
using EPiServer;
using EPiServer.Core;
using EPiServer.DataAccess;
using EPiServer.Security;
using EPiServer.Web.Hosting;
namespace EpiServerShine
{
static internal class PageDataExtensions
@timabell
timabell / NodeEntryCollection.cs
Created April 2, 2012 10:19
hierarchy reader from stack overflow
using System.Collections.Generic;
namespace util
{
/// <summary>
/// Storage and parsing of flat string based folder hierarchy.
/// See http://stackoverflow.com/a/8621711/10245
/// </summary>
/// <example><code>
/// NodeEntryCollection cItems = new NodeEntryCollection();
@timabell
timabell / gist:2291964
Created April 3, 2012 13:27
episerver url rewriting, put this in a template page's code-behind .cs
protected string ResourcePath
{
get
{
return
_pageFilesUrl ?? (_pageFilesUrl = ResolveUrl(String.Format("~/PageFiles/{0}/", FolderId)));
}
}
@timabell
timabell / poll-svn.sh
Created April 10, 2012 18:47
Poll svn server with gi-svn
#!/bin/sh
while true
do
date # note, windows (msysgit) specific syntax for printing date to console.
echo "Polling svn server..."
git svn fetch
echo "Sleeping."
sleep 300
done
@timabell
timabell / npackd-gitextensions.xml
Created May 3, 2012 16:02
npackd definition for git extensions
<root>
<spec-version>2</spec-version>
<package name="com.google.code.gitextensions">
<title>Git Extensions</title>
<url>https://code.google.com/p/gitextensions/</url>
<description>Git Extensions is the only graphical user
interface for Git that allows you control Git without
using the commandline. It comes with a manual and video
tutorials to get you started quickly.</description>
<icon>https://code.google.com/p/gitextensions/logo?cct=1311100905</icon>
@timabell
timabell / vs-bash-console.bat
Created May 7, 2012 11:59
batch script for loading git-bash and the vs tools in the same window
@echo off
REM batch script for loading git-bash and the vs tools in the same window
REM inspiration: http://www.drrandom.org/post/2011/11/16/Grappling-with-multiple-remotes-in-git-tfs.aspx
RME screenshot: https://twitter.com/#!/tim_abell/status/199474387731226624/photo/1
%HOMEDRIVE%
cd %HOMEPATH%
call "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86
echo Use full exe names when running under bash, e.g. "msbuild.exe"
echo Loading bash, you may now use git and msbuild in the same console \o/.
"C:\Program Files (x86)\Git\bin\sh.exe" --login -i
@timabell
timabell / poll-tfs.sh
Last active June 1, 2016 08:56
Poll tfs server with git-tfs
#!/bin/sh
# https://gist.github.com/timabell/2842684
# save to ~/bin/git-poll
# run with `git poll` from your git-tfs repo
# git version: https://gist.github.com/timabell/6990292
while true
do
date # note, windows (msysgit) specific syntax for printing date to console.
@timabell
timabell / missing-keys.sql
Created June 29, 2012 09:52
sql server - find tables / fields with missing keys
-- http://richarddingwall.name/2008/12/21/find-missing-foreignprimary-keys-in-sql-server/
-- Find columns on tables with names like FooID or FooCode which should
-- be part of primary or foreign keys, but aren't.
SELECT
t.name AS [Table],
c.name AS [Column],
i.*
FROM
sys.tables t