This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Author: Dimitri Reiswich | |
#include <boost/assign/std/vector.hpp> | |
// #include <boost/assign.hpp> | |
std::vector<boost::shared_ptr<RateHelper>> getRateHelperVector() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[alias] | |
st = status | |
lg = log --graph --pretty=format:'%Cred%h%Creset \n-%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' \n--abbrev-commit --date=relative | |
ol = log --pretty=format:'%Cred%h%Creset %C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
public void system_out_println() { | |
final Benchmark<Void> benchmark = Benchmark.<Void>builder() | |
.withPerformanceBenchmark(() -> { | |
System.out.println("hello, world"); | |
return null; | |
}) | |
.withName("print to screen") | |
.withIterations(25000) | |
.build(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
TODAY=$(date +"%Y%m%d") | |
LOGFILE="iphoto-backup-$TODAY.log" | |
IPHOTOS_LOCATION=$1 | |
BACKUP_LOCATION=$1 | |
mkdir "/Users/richard/tmp/backup/" | |
touch $LOGFILE | |
rsync -av "$IPHOTOS_LOCATION/Photos Library.photoslibrary/" "$BACKUP_LOCATION/Photos Library.photoslibrary" > $LOGFILE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.google.common.io.Files; | |
import com.imrichardcole.benchpress.Benchmark; | |
import org.junit.Test; | |
import java.io.File; | |
import java.io.IOException; | |
import java.nio.charset.Charset; | |
public class AliceSplit { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class StringsAndThings { | |
private static final char[] characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".toCharArray(); | |
private static final Random random = new Random(new Date().getTime()); | |
public static void main(String[] args) { | |
final String randomString = StringsAndThings.createRandomString(1000); | |
System.out.println(randomString); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'grit' | |
repo_path = ARGV[0] || "/Users/richard/Documents/work/ruby/grit" | |
tag = ARGV[1] || "v0.1" | |
repo = Grit::Repo.new(repo_path) | |
commits_since_tag = repo.commits_between(tag, "HEAD") | |
puts "#{commits_since_tag.size} commit(s) since tag #{tag}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from urllib2 import Request, urlopen | |
from sys import exit | |
import json | |
url = "teamcity url here" | |
content = "application/json" | |
request = Request(url, None, {'Accept': content}) | |
dict = json.loads(urlopen(request).read()) | |
status = dict['build'][0]['status'] |