Skip to content

Instantly share code, notes, and snippets.

@zeroDivisible
zeroDivisible / gist:7206769
Created October 28, 2013 23:41
Java & add hours to calendar.
Calendar cal = Calendar.getInstance(); // creates calendar
cal.setTime(new Date()); // sets calendar time/date
cal.add(Calendar.HOUR_OF_DAY, 1); // adds one hour
cal.getTime(); // returns new date object, one hour in the future
postgres=# \dx
List of installed extensions
Name | Version | Schema | Description
---------+---------+------------+------------------------------
plpgsql | 1.0 | pg_catalog | PL/pgSQL procedural language
(1 row)
postgres=# \dx+
Objects in extension "plpgsql"
Object Description
@zeroDivisible
zeroDivisible / gist:7039306
Created October 18, 2013 09:58
Java's simple date format for parsing UTC dates.
final SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH':'mm':'ss'.'SSSS'Z'");
select pg_terminate_backend(pid int)
@zeroDivisible
zeroDivisible / config
Created October 10, 2013 14:35
Snippet from ~/.ssh/config for adding a bridge ssh host when connecting to a target machine (as in "this machine can only be accessed from that other machine")
Host targetHost
HostName 8.8.8.8
Port 22
User username
ProxyCommand ssh username@bridgehost -W %h:%p
@zeroDivisible
zeroDivisible / gist:6582823
Created September 16, 2013 16:12
Generation of secure SSH Key
ssh-keygen -t rsa -C "email"
openssl pkcs8 -topk8 -v2 des3 -in ~/.ssh/id_digitalocean -out ~/.ssh/id_digitalocean
# to check if generated correctly
cat .ssh/id_digitalocean.pub
scp ~/.ssh/id_digitalocean.pub <user>@<yourhost>:.ssh/authorized_keys
@zeroDivisible
zeroDivisible / gist:6342202
Last active December 21, 2015 17:39
Java VM debug command line flags I'm always forgetting one or two of those, so I'm adding them here.
-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address={PORT}
This file has been truncated, but you can view the full file.
A
a
aa
aal
aalii
aam
Aani
aardvark
aardwolf
Aaron
@zeroDivisible
zeroDivisible / gist:5936526
Last active January 28, 2025 12:09
Learning Japanease, taken from http://pastebin.com/w0gRFM0c
Resources marked with > are used, have been used, or are actively advocated in the threads. This applies for everything in the [Necessities] section.
[Necessities]
Hiragana & Katakana: http://www.realkana.com/
Kanji: http://kanjidamage.com/
Japanese IME: http://www.google.com/intl/ja/ime/
Anki Flashcards: http://ankisrs.net/
Genki (↓Bottom↓)
Tae Kim Japanese: http://www.guidetojapanese.org/learn/grammar