Skip to content

Instantly share code, notes, and snippets.

View eddarmitage's full-sized avatar

Edd Armitage eddarmitage

View GitHub Profile
import org.junit.Test;
import java.util.Arrays;
import java.util.List;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.SoftAssertions.assertSoftly;
public class AllSoftlyMatchTest {
@Test
@eddarmitage
eddarmitage / HasOnlyOneElementSatisfyingTest.java
Created July 10, 2016 21:06
I expected the following usage of hasOnlyOneElementSatisfying to pass - perhaps the current implementation would be better described as hasOnlyOneElementAndSatisfies?
import org.junit.Test;
import java.util.Arrays;
import java.util.List;
import static org.assertj.core.api.Assertions.assertThat;
public class HasOnlyOneElementSatisfyingTest {
@Test
public void whatIExpectedToPass() {
@eddarmitage
eddarmitage / gist:2149107
Created March 21, 2012 16:10
brew update error installing qrupdate
==> Downloading http://downloads.sourceforge.net/qrupdate/qrupdate-1.1.1.tar.gz
Already downloaded: /Users/Edd/Library/Caches/Homebrew/qrupdate-1.1.1.tar.gz
/usr/bin/tar xf /Users/Edd/Library/Caches/Homebrew/qrupdate-1.1.1.tar.gz
==> Using Homebrew-provided fortran compiler.
This may be changed by setting the FC environment variable.
==> make -j 1 install
make -j 1 install
/usr/local/bin/gfortran -Os -w -pipe -march=native -Qunused-arguments -fPIC -c caxcpy.f
caxcpy.f:0: error: bad value (native) for -march= switch
@eddarmitage
eddarmitage / InstallingGitUsingYum.md
Created March 8, 2012 14:03
Installing git on CentOS 5 using yum

Installing git on CentOS 5 using yum

Since you're using CentOS 5, the default package manager is yum, not apt-get. To install a program using it, you'd normally use the following command:

$ sudo yum install <packagename>

However, when trying to install git this way, you'll encounter the following error on CentOS 5:

@eddarmitage
eddarmitage / TS Question.md
Created March 7, 2012 21:21
Photo.StackExchange.com Tilt-Shift Question

Why does using a tilt-shift lens make things look miniature?

This question isn't so much about how to achieve the effect of making a scene look like it's modelled in miniature, but why tilting the focal plane creates the effect. What is it about photographing miniatures that makes them look like miniatures, and how is this replicated by tilting the focal plane?

I can understand how when photographing a model of a scene, you have a much higher magnification, which leads to a shallower depth of field compared to when capturing the real-sized scene, but how does tilting the focal plane help? Is it just that you have the focal plane tilted relative to the plane that most of your subject is on, so that you can achieve a narrower depth of field for the focal length and aperture, or is there more to it than that?

@eddarmitage
eddarmitage / securing_rails_updates.md
Created March 5, 2012 16:13 — forked from peternixey/securing_rails_updates.md
How Homakov hacked GitHub and how to protect your application

##How Homakov hacked GitHub and the line of code that could have prevented it


Please note: THIS ARTICLE IS NOT WRITTEN BY THE GITHUB TEAM or in any way associated with them. It's simply hosted as a Gist because the markdown formatting is excellent and far clearer than anything I could manage on my personal Tumblr at peternixey.com.

If you'd like to follow me on twitter my handle is @peternixey


@eddarmitage
eddarmitage / gist:1683628
Created January 26, 2012 16:27
PThreads Typo???
void hello(int *n)
{
printf("hello %d\n",*n);
}
int main(void)
{
int m;
pthread_t thr1, thr2;