This file contains hidden or 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
//http://www.apache.org/licenses/LICENSE-2.0 | |
package nl.fnord.junit; | |
import org.junit.runner.notification.RunNotifier; | |
import org.junit.runners.BlockJUnit4ClassRunner; | |
import org.junit.runners.model.FrameworkMethod; | |
import org.junit.runners.model.InitializationError; | |
/** | |
* A JUnit {@code Runner} that behaves like the default runner on Windows and |
This file contains hidden or 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
/** Validate BSN according to http://nl.wikipedia.org/wiki/Burgerservicenummer */ | |
private boolean isValidBSN(int candidate) { | |
if (candidate <= 9999999 || candidate > 999999999) { | |
return false; | |
} | |
int sum = -1 * candidate % 10; | |
for (int multiplier = 2; candidate > 0; multiplier++) { | |
int val = (candidate /= 10) % 10; | |
sum += multiplier * val; |
This file contains hidden or 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
find . -name '*.smali' \ | |
| grep -vE 'actionbarsherlock|watson|support' \ | |
| xargs grep -F const-string \ | |
| awk '{ print substr($0, index($0, "\"")) }' \ | |
| sort \ | |
| uniq |
This file contains hidden or 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
# Processes Ant JUnit logging output into tab separated values. | |
# | |
# [junit] Running com.myapp.MyTest | |
# [junit] Tests run: 2, Failures: 0, Errors: 0, Time elapsed: 0.721 sec | |
# | |
# Suite Num tests Num failed Num error Time (s) | |
# com.myapp.MyTest 2 0 0 0.721 | |
# | |
BEGIN { | |
testname="" |
This file contains hidden or 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
# Sony camera emits GPS data in NMEA format [1] | |
# | |
# The $GPRMC records contain velocity | |
# | |
# $GPRMC,043151.097,A,5203.5674,N,513.4071,E,14.56,,010814,,,A*43 | |
# ^ ^ ^ ^ ^ ^ ^ | |
# | | | | | | \-Checksum | |
# | | | | | | | |
# | | | | | \- date, ddmmyy | |
# | | | | \-------- velocity in knots |
This file contains hidden or 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
package com.example; | |
import android.os.Bundle; | |
import android.view.KeyEvent; | |
import android.view.inputmethod.CompletionInfo; | |
import android.view.inputmethod.CorrectionInfo; | |
import android.view.inputmethod.ExtractedText; | |
import android.view.inputmethod.ExtractedTextRequest; | |
import android.view.inputmethod.InputConnection; | |
import android.view.inputmethod.InputConnectionWrapper; |
This file contains hidden or 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
{ | |
"version": 1, | |
"disable_existing_loggers": true, | |
"formatters": { | |
"debug": { | |
"format": "[%(levelname)s][%(asctime)s](%(funcName)s/%(lineno)d) %(message)s", | |
"datefmt": "%Y-%m-%d %H:%M:%S" | |
}, | |
"simple": { | |
"format": "[%(levelname)s][%(asctime)s] %(message)s", |
This file contains hidden or 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
{ | |
"version": 1, | |
"disable_existing_loggers": true, | |
"filters": { | |
"my_filter": { | |
"()": "filters.MyFilter" | |
} | |
}, | |
"formatters": { | |
"debug": { |
This file contains hidden or 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
# Disables automatic substitution of "" by “” | |
defaults write NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool false | |
# Disables automatic subsitution of -- by – | |
defaults write NSGlobalDomain NSAutomaticDashSubstitutionEnabled -bool false |
This file contains hidden or 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
// In buildSrc/src/main/groovy/ | |
import org.eclipse.jgit.api.Git | |
import org.eclipse.jgit.lib.RepositoryBuilder | |
import org.gradle.api.Project | |
class GitFunctions { | |
public static String headCommitAndStatus(Project project) { | |
def repo = new RepositoryBuilder() |
OlderNewer