Skip to content

Instantly share code, notes, and snippets.

<html>
<head>
<style type="text/css">
table table {
width: 600px !important;
}
table div + div { /* main content */
width: 65%;
float: left;
}
@xtraclass
xtraclass / 0_reuse_code.js
Created December 26, 2013 14:46
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@xtraclass
xtraclass / gist:5650600
Created May 25, 2013 20:09
Command for building vim 7.3 o RH6
./configure --prefix=/usr --with-compiledby="Thomas Eichberger" --with-features=huge --enable-rubyinterp --enable-pythoninterp --disable-darwin --enable-fontset --enable-gui=gnome2 -with-x && make && make install && vim --version
@xtraclass
xtraclass / gist:5650587
Created May 25, 2013 20:06
Simple class for downloading artifacts from a private Nexus repository (usually a company makes its own private repository, in this case it is called aaa)
#!/usr/bin/python
import urllib2, sys
class NexusDownloader:
'''Simple class for downloading artifacts from a private Nexus repository.'''
nexus = 'http://nexus.aaa.com/nexus/service/local/artifact/maven/redirect?'
@xtraclass
xtraclass / gist:5650579
Created May 25, 2013 20:03
bash script for installing a SCM server (i.e. Puppet master). Didn't use that for a while, don't know if it still works.
#!/bin/bash
#
# Setup script for a new
#
# Software Configuration Server
#
# with:
# - a Puppet server
# - including my Puppet modules
# - a Git repository
@xtraclass
xtraclass / gist:5650557
Created May 25, 2013 19:58
git push 101
git add -A .
git commit
git push --tags -u origin master
@xtraclass
xtraclass / gist:5650550
Created May 25, 2013 19:55
Java SWING PLAF
public static final void setupPLAF()
{
Options.setUseNarrowButtons( false );
PlasticLookAndFeel.setHighContrastFocusColorsEnabled( true );
PlasticLookAndFeel.setPlasticTheme( new SkyYellow() );
try
{
@xtraclass
xtraclass / gist:5650524
Created May 25, 2013 19:47
Java: saves a JPEG Buffered Image to a file. Uses the old Sun packages :-)
import com.sun.image.codec.jpeg.*;
...
public static void saveImageToFile( BufferedImage image, File file )
throws IOException
{
if ( image == null || file == null ) return;
file.delete();
@xtraclass
xtraclass / gist:5650505
Created May 25, 2013 19:41
Simple wrapper function which connects to a database system, performs a given function on the database, and closes the database connection.
/**
* This method calls the given function.
* <p>
* This method can be used to do something within the database without thinking about opening and closing a database connection.
* <p>
* First it opens a database connection, if none is open.
* Then it calls the given function.
* Finally it closes the database connection, if one is open.
* <p>
* If an exception is thrown within the given function, this method re-throws it.
@xtraclass
xtraclass / .tmux.conf
Created May 25, 2013 19:33
tmux configuration file
###############################################################################################
# Ctrl-A as prefix key
###############################################################################################
set-option -g prefix C-a
unbind-key C-b
bind-key a send-prefix
###############################################################################################
start-server