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
public void setGameState(GameState gameState) { | |
if (gameState != this.gameState) { | |
if (this.gameState != null) { | |
// unregister listeners/observers | |
} | |
this.gameState = gameState; | |
if (gameState != null) { | |
// register listeners/observers | |
} | |
} |
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
/* | |
* UnixPasswordField -- A unix style password input | |
* Copyright (C) 2012 Jakob Schöttl | |
* | |
* This program is free software: you can redistribute it and/or modify | |
* it under the terms of the GNU General Public License as published by | |
* the Free Software Foundation, either version 3 of the License, or | |
* (at your option) any later version. | |
* | |
* This program is distributed in the hope that it will be useful, |
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
module Main (main) where | |
import System.Environment (getArgs) | |
import Data.Maybe (maybeToList) | |
import Data.List.Utils (uniq) | |
import Distribution.Verbosity (normal) | |
import Distribution.Package (Dependency) | |
import Distribution.PackageDescription | |
import Distribution.PackageDescription.Parse (readPackageDescription) |
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
/* | |
* Released under | |
* The MIT License (MIT) | |
* Copyright (c) 2016 Jakob Schöttl | |
*/ | |
package edu.hm.cs.vadere.seating.traingen; | |
import java.util.List; | |
import java.util.Map; |
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
function! ExportAndOpenHtml() range | |
execute a:firstline . ',' . a:lastline . 'TOhtml' | |
execute 'silent !xdg-open %' | |
quit | |
redraw! | |
endfunction | |
nnoremap <Leader>h :0,$call ExportAndOpenHtml()<CR> | |
vnoremap <Leader>h :call ExportAndOpenHtml()<CR> |
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 | |
# utf82latex - Convert UTF-8 encoded input to ASCII encoded LaTeX | |
# warning: | |
# does not work if input contains double quotes (") or back slashes (\) | |
# usage: | |
# in Vim: :%!utf82latex | |
# in shell: xclip -o -selection c | utf82latex | xclip -selection c | |
# in shell: utf82latex <<EOF | xclip -selection c |
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
-- See http://jakob.keramik-schoettl.de/blog/ | |
-- usage: rewrite-after-timeout SECONDS FILENAME | |
import Prelude | |
import System.IO | |
import System.Timeout | |
import System.Environment | |
import Data.Time | |
import Data.Maybe | |
import Control.Monad |
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 | |
# Change the hosts file /etc/hosts - must run as root. | |
# To be used with a cron job or systemd service to automatically | |
# adjust the hosts file depending on the network the computer is in. | |
printUsage() { | |
cat <<EOF | |
usage: $PROGNAME (-a | -n NETWORK) DOMAIN_NAME IP_ADDRESS | |
$PROGNAME -r DOMAIN_NAME | |
options: |
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
-- required packages: split orgmode-parse | |
import qualified Data.Text as T | |
import Data.OrgMode.Parse | |
import Data.OrgMode.Types (Document (..), Headline (..), Section (..), Properties (..)) | |
import Data.Attoparsec.Text | |
import Data.Maybe | |
import qualified Data.HashMap.Lazy as M | |
import Data.List.Split |
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 | |
# Switch the current audio output device. | |
# Without options: Toggle between two sinks. | |
# This script works for PulseAudio; pactl must be installed. | |
printUsage() { | |
cat <<EOF | |
usage: $PROGNAME [options] | |
options: |
OlderNewer