Skip to content

Instantly share code, notes, and snippets.

View rupertbates's full-sized avatar

Rupert Bates rupertbates

  • Guardian News and Media
  • London
View GitHub Profile
public string TestReturn(int i)
{
return "hello hello hello";
}
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />
</configSections>
<log4net>
<appender name="FileAppender" type="log4net.Appender.FileAppender">
<file value="../../logs/Log4Net.log"/>
<appendToFile value="false"/>
@rupertbates
rupertbates / gist:277153
Created January 14, 2010 13:21
Open Platform blog code snippets
//Get all users over the ages of 18
var adults = users.Where(u => u.Age > 18);
@rupertbates
rupertbates / Remove .DS_Store files from git
Created November 22, 2012 15:18
Remove .DS_Store files from git
find . -name .DS_Store -print0 | xargs -0 git rm --ignore-unmatch
@rupertbates
rupertbates / git log not master
Created December 14, 2012 11:31
Find all commits in <branch> which are not in master and mention an Android bug number
git log <branch> --not master --oneline | grep AND-
@rupertbates
rupertbates / addFieldToMongoRecords.js
Created December 19, 2012 10:27
Add a field to all records in a Mongo collection
db.registration.update({},{$set : { "receiveNewsAlerts" : true}} , true, true);
@rupertbates
rupertbates / Mongo matchWeek find.js
Created January 7, 2013 17:49
Find Mongo matchWeek records between a certain number, filter the result fields and then sort
db.matchWeek.find({number:{$gt:18, $lt:23}}, {number: 1, startDate:1, endDate:1}).sort({number:1}).pretty()
@rupertbates
rupertbates / git-colours.git
Created January 12, 2013 22:11
Switch on colours in Git
git config --global color.ui true
@rupertbates
rupertbates / numlines.sh
Created January 30, 2013 10:44
Get number of lines in file with Awk
awk 'END{print FNR}';
@rupertbates
rupertbates / delete-intellij.sh
Created March 14, 2013 16:51
Delete all IntelliJ settings - Removes all saved IntelliJ settings on Mac OS
find ~/Library -iname *intellij* -exec rm -rf {} \;