Skip to content

Instantly share code, notes, and snippets.

public enum FuBar
{
ONE("one"),
TWO("two");
private static final String PATT;
private static final Map<String,FuBar> MAP;
static
@sas101
sas101 / git_svn_bash_prompt.sh
Created October 24, 2012 07:25 — forked from woods/git_svn_bash_prompt.sh
Set color bash prompt according to git/svn branch, and return status of last command.
#!/bin/bash
#
# DESCRIPTION:
#
# Set the bash prompt according to:
# * the branch/status of the current git repository
# * the branch of the current subversion repository
# * the return value of the previous command
#
# USAGE:
@sas101
sas101 / findbugs.gradle
Created February 2, 2012 19:04 — forked from bendisposto/findbugs.gradle
Findbugs Gradle script
configurations{
findbugs
}
dependencies {
findbugs 'com.google.code.findbugs:findbugs:2.0.0'
//findbugs 'com.google.code.findbugs:findbugs-ant:1.3.9'
}
@sas101
sas101 / findbugs.gradle
Created February 2, 2012 19:03 — forked from anonymous/findbugs.gradle
findbugs.gradle
configurations{
findbugsConf
}
def convention = new FindBugsPluginConvention(project)
project.convention.plugins.findbugs = convention
class FindBugsPluginConvention{
def reportPath;
@sas101
sas101 / jenkins.conf
Created October 9, 2011 13:27
Jenkins job file for Upstart using tomcat-server-manager
# Jenkins - jenkins job file for upstart
description "Jenkins CI build server using tomcat-server-manager"
author "Stefan Simroth <stefan@ubicoo.com>"
# When to start the service
start on runlevel [12345]
# When to stop the service
stop on runlevel [06]
@sas101
sas101 / hsl.php
Created September 24, 2011 14:31 — forked from bastianallgeier/hsl.php
<?php $hsl = rand(0, 240) . ',' . rand(50, 80) . '%,60%'; ?>
<style type="text/css">
a {
color: hsl(<?php echo $hsl ?>);
}
</style>
@sas101
sas101 / gist:1119942
Created August 2, 2011 10:05 — forked from kevinmcmahon/gist:1005881
Android If-Modified-Since
HttpClient httpClient = new DefaultHttpClient();
HttpHead httpHead = new HttpHead(accountUrl);
long date = cachedFile.lastModified();
String lastModified = DateUtils.formatDate(new Date(date), "EEE, d MMM yyyy HH:mm:ss 'GMT'");
httpHead.addHeader("If-Modified-Since", lastModified);
HttpResponse response = httpClient.execute(httpHead);
int statusCode = response.getStatusLine().getStatusCode();
return statusCode != HttpStatus.SC_NOT_MODIFIED;
@sas101
sas101 / gist:892384
Created March 29, 2011 13:45 — forked from ydn/gist:360872
<?php // a super-stripped down 2-leg oauth server/client example
//http://oauth.net/code/
//http://oauth.googlecode.com/svn/code/php/OAuth.php
require 'oauth.php';
$key = 'key';
$secret = 'secret';
$consumer = new OAuthConsumer($key, $secret);
$sig_method = new OAuthSignatureMethod_HMAC_SHA1;
@sas101
sas101 / commands.tex
Created February 27, 2011 17:14
LaTeX Befehle
% LaTeX Befehle %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%% TODO Text
\newcommand{\Todo}[1][]{{\color{red} TODO #1}\normalfont}
% erzeugt ein Listenelement mit fetter Überschrift
\newcommand{\itemd}[2]{\item{\textbf{#1}}\\{#2}}
%%%%%%%% Abkürzungen mit korrektem Leerraum
\newcommand{\Abk}[1]{\mbox{#1}\xspace}
@sas101
sas101 / notracking.html
Created February 27, 2011 10:48
No Google Analytics Tracking
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<title>No Tracking</title>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_gat._anonymizeIp']);
_gaq.push(['_setCustomVar', 1, 'no_analytics_tracking', '1', 1]);