Skip to content

Instantly share code, notes, and snippets.

View ffbit's full-sized avatar

D H ffbit

  • Here GmbH
  • Germany, Frankfurt am Main Area
View GitHub Profile
@ffbit
ffbit / plugin.sh
Created June 4, 2013 19:00
Create maven plugin
mvn archetype:generate \
-DgroupId=com.ffbit.maven.plugins \
-DartifactId=solr-maven-plugin \
-DarchetypeGroupId=org.apache.maven.archetypes \
-DarchetypeArtifactId=maven-archetype-mojo
/*
* Copyright (c) 2012, Luigi R. Viggiano
* All rights reserved.
*
* This software is distributable under the BSD license.
* See the terms of the BSD license in the documentation provided with this software.
*/
package org.aeonbits.owner;
# Selenium launcher is a great npm module for booting
# selenium server via a Node.js process.
selenium = require 'selenium-launcher'
soda = require 'soda'
process.env.NODE_ENV = "cucumber"
# This is our app's file.
server = require '../../server'
# We add some empty variables to store the web browser
function asyncForeach(array, fn, callback) {
var completed = 0;
var arrayLength = array.length;
if(arrayLength === 0) {
callback();
}
for(var i = 0; i < arrayLength; i++) {
fn(array[i], i, function() {
completed++;
if(completed === arrayLength) {
@ffbit
ffbit / pass-gen-apg.sh
Created April 13, 2013 18:07
apg password generator
#!/bin/bash
apg -a 0 -t -s
@ffbit
ffbit / pom.xml
Created March 23, 2013 13:48
Java 1.6 Maven pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.ffbit</groupId>
<artifactId>some-artifact</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
@ffbit
ffbit / pr.md
Created March 21, 2013 08:31 — forked from piscisaureus/pr.md

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@ffbit
ffbit / sonar-prepare.sql
Created March 3, 2013 12:19
Sonar PostgreSQL preparation
CREATE ROLE sonar WITH LOGIN PASSWORD 'password';
CREATE DATABASE sonar
WITH OWNER = sonar
ENCODING 'UTF8';
GRANT ALL PRIVILEGES ON DATABASE sonar TO sonar;
@ffbit
ffbit / sbt-useful-commands.md
Created February 25, 2013 13:03
SBT useful commands

Download sources and javadoc for all dependencies

sbt update-classifiers

For further information read Useful SBT Commands.

@ffbit
ffbit / PermutationNumber.java
Last active December 14, 2015 04:09
Find sequence number of a particular permutation in a lexicographical order.
package com.ffbit.permutation;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
import java.util.Arrays;
import java.util.Collection;
import org.junit.Test;
import org.junit.runner.RunWith;