Skip to content

Instantly share code, notes, and snippets.

View adamralph's full-sized avatar
🤗
Living the dream

Adam Ralph adamralph

🤗
Living the dream
View GitHub Profile
@adamralph
adamralph / jabbr-spam.js
Created April 23, 2014 20:10
JabbR spam removal bookmarklet
javascript:(function(){$('li[data-name=sttriviabot].message').remove();$('li[data-name=sahin].message').remove();$('li[data-name=tacobell8888].message').remove();})();
@adamralph
adamralph / xbehave.dry.cs
Created October 12, 2013 07:22
xBehave DRY example
[Scenario]
public static void DoctorBillPostsToHisOwnBlog()
{
GivenIAmLoggedInAs("Dr. Bill", "oranges");
// When, Then...
}
[Scenario]
public static void GregPostsToAClientBlog()
{
Add("web-greeting", "Hello World from web!");
@adamralph
adamralph / sample-config.csx
Created July 19, 2013 17:28
Sample ConfigR config file
Configurator.Add("web-greeting", "Hello World from web!");
@adamralph
adamralph / scriptcs-hello-world.csx
Created July 7, 2013 16:58
ScriptCs Hello World
Console.WriteLine("Hello world!");
@adamralph
adamralph / .gitconfig
Last active February 6, 2021 10:38
My global .gitconfig
[user]
name = Adam Ralph
email = adam@adamralph.com
[core]
autocrlf = false
editor = \"C:/Users/adam/AppData/Local/Programs/Microsoft VS Code/Code.exe\" --wait
sshCommand = C:/Windows/System32/OpenSSH/ssh.exe
[alias]
dtag = !git tag -l | xargs git tag -d
prune-all = !git remote | xargs -n 1 git remote prune
@adamralph
adamralph / gist:5607308
Last active December 17, 2015 12:09
Feature request: option to view line endings (sent to GitHub support 19-May-2013)

One of the common battles which we continue to fight as an accident of history is that of line endings. Even though we can take measures such as autocrlf policies and .gitattributes to try and eradicate the pain, it's a nuisance which keeps biting.

A feature which I think would help a lot, is the ability to see line endings in the GitHub UI. The default can stay as is (no line endings shown), but it would be great to have a toggle which allows me to switch on visible line endings in my view. This would be great in all file views, not only the standard view but also in the diff view when looking at commits, pull requests, etc.

As for a graphical representation, I think something like what TortoiseMerge does would be nice, i.e. a straight downward arrow for LF and a right angled arrow for CRLF. E.g. http://adamralph.com/img/eol.png

Whatever representation is chosen it just needs to be clearly distinguishable and obvious which is which.

Regards Adam

using System;
using System.Linq;
using FluentAssertions;
using Xbehave;
using Xunit;
public class AccountsFeature
{
private Account account;
@adamralph
adamralph / gist:5491576
Created April 30, 2013 20:13
new fork UI mail
Hi,
I really like the new fork UI with the large user/org icons.
There's just one problem - I previously used this as a shortcut to my own fork of a repo.
The old UI used to say something like 'fork already exists' against my user name with a link 'go to the fork'.
The new UI just says 'fork already exists' and doesn't let me click my user icon (the mouse turns into a red 'no entry' cursor).
@adamralph
adamralph / gist:5076908
Last active December 14, 2015 11:09
FakeItEasy Should_match_lambda_arguments
[Test]
public void Should_match_lambda_arguments()
{
// Arrange
var fake = A.Fake<ITypeWithMethodWithDelegateParameter>();
var action = (Action)(() => { });
var other = (Action)(() => { });
// Act
fake.Foo(action);