Skip to content

Instantly share code, notes, and snippets.

View MattesGroeger's full-sized avatar

Mattes Groeger MattesGroeger

View GitHub Profile
program subcriterion_2_2_2 Count methodology hostCountry projectType
0 ACR_ERTs 1.0 118 {ACR_AfforestationReforestation_Methodology_V1.2} {RWA, SLV, ETH, GIN, PER, TZA, BEN, IDN, MMR, THA, BGD, AGO, LBR, SOM, COM, PNG, MDG, MEX, SDN, VUT, NPL, NAM, TGO, BDI, BRA, SEN, KEN, MWI, COD, NIC, BOL, TCD, NGA, LSO, ZAF, ERI, SLE, ZWB, CMR, ... {CAF, ENF}
1 ACR_ERTs 5.0 462 {ACR_AfforestationReforestation_Methodology_V1.2, ACR_Landfill_Project_Methodology_V2, ACR_IFM_non-Federal_US_Forestlands_V2} {EGY, MMR, SYC, MHL, URY, COM, MEX, YEM, SWZ, USA, SEN, NRU, GBR, CHL, NGA, CAF, ROU, MNG, FSM, LCA, CYP, SYR, ZWE, LUX, ATG, ISR, BIH, FJI, GNB, IRQ, HTI, UGA, LIE, HRV, AUS, ALB, SGP, GIN, ETH, ... {CAF, IFM, ENF, LFGU}
2 CAR_CRTs 5.0 7 {CAR_Landfill_Project_Protocol_V5, CAR_Forest_Project_Protocol_V4, CAR_Mexico_Livestock_Protocol_V2, CAR_US_Livestock_Protocol_V4, CAR_Forest_
@MattesGroeger
MattesGroeger / applause-template
Last active October 11, 2018 08:13
Use this template for communicating changes to Applause
*Version : x.x.x (Build xxxx)*
*_TITLE OF THIS RELEASE_*
*Description:*
• *Section:* change
• ...
*Bug fixes:*
• Fixed ...
@MattesGroeger
MattesGroeger / Example.swift
Created June 21, 2017 12:24
Generic in-memory cache implementation for Swift 3.0
// create a chache with 60 seconds expiration time
var cache: InMemoryCache = InMemoryCache<LocalUrl>(expirationInSeconds: 60)
// data will either be returned from cache or created via callback and then returned
let data = cache.cachedData {
// do the heavy object creation here
return MyHeavyObject()
}
// invalidate the cache, next call will have to re-create the heavy object
@MattesGroeger
MattesGroeger / CAMediaTimingFunctionExtension.swift
Created August 12, 2016 14:47
This Swift extension allows to use more timing functions than the default ones provided by `CAMediaTimingFunction`. It's based on the work of Christian Giordano: https://gist.github.com/nuthinking/7415509
import QuartzCore
enum BezierType {
case Default
case Linear
case EaseIn
case EaseOut
case EaseInOut
@MattesGroeger
MattesGroeger / Rakefile
Last active January 4, 2016 19:09
Run commands from Ruby (e.g. Rakefile) with real time output and exiting on non-0 exit codes.
desc 'Build'
task :build do
run("xbuild Project.sln", "Build failed")
run("nunit-console Tests/bin/Debug/Project-Tests.dll", "Tests failed")
run("mono Tests/vendor/NSpecRunner.exe Tests/bin/Debug/Project-Tests.dll", "Specs failed")
end
task :default => :demo
# This is the important method
@MattesGroeger
MattesGroeger / vb_bootcamp.sh
Created January 18, 2014 12:35
I use the following script to boot my Windows 7 bootcamp partition under OSX with VirtualBox. Replace the name of your Bootcamp partition and the name of your VirtualBox image accordingly. The script was written after following this description: http://www.kevinrockwood.info/2010/04/windows7-in-osx-with-bootcamp-and-virtualbox/
#!/bin/sh
# find and unmount volume (change 'BOOTCAMP' name accordingly)
amount=`diskutil list | grep BOOTCAMP | wc -l`
if [ $amount = 1 ]
then
path=`diskutil list | grep BOOTCAMP | sed -e 's/^\(.*\)\(disk0s.\)$/\/dev\/\2/g'`
sudo chmod 777 $path
diskutil unmount $path
fi
# http://www.mono-project.com/Compiling_Mono_on_OSX
require 'formula'
class Mono < Formula
url 'http://download.mono-project.com/sources/mono/mono-3.2.3.tar.bz2'
homepage 'http://www.mono-project.com/'
sha1 'e356280ae45beaac6476824d551b094cd12e03b9'
def install
@MattesGroeger
MattesGroeger / Kiwi (new)
Created November 8, 2013 10:23
I just re-factored this OCUnit code to Kiwi
[[[user1Dict[@"highscores"] valueForKey:@"fb_id"] should] contain:fbId_user2];
[[[user2Dict[@"highscores"] valueForKey:@"fb_id"] should] contain:fbId_user1];
@MattesGroeger
MattesGroeger / UIImageView+Mask.h
Last active December 17, 2015 10:59
With this category of `UIImageView` you can apply a mask (grey-scale jpg) onto a given image. The mask is then applied on that existing image. With this technique you can use 2 compressed JPG's (not transparent image + mask) rather than one big PNG file.
#import <Foundation/Foundation.h>
@interface UIImageView (Mask)
- (void)applyMask:(NSString *)maskName;
@end
@MattesGroeger
MattesGroeger / NSNotificationMatcher.h
Created November 13, 2012 14:44
Matcher for Kiwi testing framework that allows testing notifications.
#import "KWHCMatcher.h"
#import "KWMessageTracker.h"
#import "Kiwi.h"
@interface NSNotificationMatcher : NSObject <HCMatcher>
{
NSDictionary *_userInfo;
}
+ (id)matcherWithUserInfo:(NSDictionary *)dictionary;