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 java.util.Collections; | |
import java.util.HashMap; | |
import java.util.Map; | |
// There's more than one way to do it | |
public class StaticInitialization { | |
private static final Map<String, String> MAP_ONE = new HashMap<String, String>() {{ | |
put("one", "1. first"); | |
}}; |
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
(prefer-coding-system 'utf-8) | |
(set-default-coding-systems 'utf-8) | |
(set-terminal-coding-system 'utf-8) | |
(set-keyboard-coding-system 'utf-8) | |
(setq default-buffer-file-coding-system 'utf-8) | |
(if (eq window-system 'x) | |
(setq x-select-request-type '(UTF8_STRING COMPOUND_TEXT TEXT STRING))) | |
(if (eq system-type 'windows-nt) |
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
#!/usr/bin/env perl | |
=head1 NAME | |
colorize.pl - adds colors to e.g. log files using ANSI escape codes | |
=head1 SYNOPSIS | |
colorize.pl LOGFILE | |
some_command | colorize.pl |
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/env perl | |
use warnings; | |
use strict; | |
my $line = "one,two, three, four , five "; | |
sub print_list { | |
printf "[%s]\n", join(', ', @_); | |
} |
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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Open Link in IE</title> | |
<meta name="author" content="Søren Lund"> | |
<!-- We expect IE browser --> | |
<style>span.showIE { display: inline } span.hideIE { display: none }</style> |
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
@echo off | |
rem This is an init script for the default "shell" on windows: cmd. | |
rem | |
rem You can try it out by calling cmd /k c:\path\to\file\.cmdrc.bat | |
rem | |
rem For a more permanent solution do the following: | |
rem | |
rem 1) copy this file to %USERPROFILE% | |
rem 2) Set the AutoRun key like this: |
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/bash | |
SRCDIR=/root/build/JSPWiki | |
WIKIDIR=/jspwiki | |
CONFDIR=/etc/jspwiki | |
DEPLOYDIR=/opt/java/tomcat/conf/Catalina/localhost | |
test -z $1 && echo "USAGE: $(basename $0) wikiname" && exit 1 | |
test -d $WIKIDIR/$1 && echo "The name $1 is already used" && exit 1 |
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
#!/usr/bin/env perl | |
use warnings; | |
use strict; | |
use Pod::Usage; | |
=head1 NAME | |
java_class_version.pl - determines the version of a java class file |
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 java.util.HashMap; | |
import java.util.Map; | |
import com.google.common.collect.ImmutableMap; | |
public class PrintOS { | |
private static final Map<String, String> MSG = ImmutableMap | |
.of("unix", "This is a UNIX box and therefore good.", | |
"windows", "This is a Windows box and therefore bad.", |
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
/* vim: ts=4 noet ai : | |
$Id: pwdcomposer.user.js 79 2006-09-08 07:44:01Z joe $ | |
CREDITS | |
======= | |
Inspired by Nick Wolff's bookmarklet "Generate Password" | |
http://angel.net/~nic/passwdlet.html | |
MD5 hash functions (c) Paul Johnston |
OlderNewer