Skip to content

Instantly share code, notes, and snippets.

View atog's full-sized avatar

Koen Van der Auwera atog

View GitHub Profile
@atog
atog / rbenv-install-1.9.3.sh
Created February 15, 2018 13:45
Install Ruby 1.9.3 with rbenv
curl -fsSL https://gist.github.com/FiveYellowMice/c50490693d47577cfe7e6ac9fc3bf6cf.txt | env PKG_CONFIG_PATH=/usr/
lib/openssl-1.0/pkgconfig:/usr/lib/pkgconfig rbenv install --patch 1.9.3-p551
@atog
atog / ghost_migrate.rb
Created March 21, 2018 14:44
Migrate Ghost json export to Markdown files for static generation
require 'json'
require 'open-uri'
class GhostMigrate
attr_accessor :archive, :posts, :tags, :posts_tags, :template, :base_url
def run(filename, url)
@archive = JSON.parse(File.read(filename))
@posts = archive["db"][0]["data"]["posts"]
set -g default-command fish
# Easy config reload
bind-key R source-file ~/.tmux.conf \; display-message "tmux.conf reloaded."
# vi is good
setw -g mode-keys vi
set-option -g default-terminal screen-256color
bind-key : command-prompt
require 'psych'
class MemoryPicker
STORAGE_NAME = "picked.yml"
def initialize(path)
@path = path
@storage = read_or_initialize_storage
end

Keybase proof

I hereby claim:

  • I am atog on github.
  • I am atog (https://keybase.io/atog) on keybase.
  • I have a public key whose fingerprint is 2B3B 8F7A 9009 11F7 3E67 03F5 7B29 9633 E6C5 A1D4

To claim this, I am signing this object:

@atog
atog / worldClockDateTime.java
Created November 7, 2018 12:14
Simple Java Android JSON API call to get Current DateTime
public Calendar getWorldClockCurrentDateTime() {
URLConnection connection = new URL("http://worldclockapi.com/api/json/cet/now").openConnection();
BufferedReader bfr = new BufferedReader(new InputStreamReader(connection.getInputStream()));
JSONObject dateTimeJson = new JSONObject(bfr.readLine());
Date date = dateParser.parse(dateTimeJson.getString("currentDateTime"));
Calendar rvalue = Calendar.getInstance();
rvalue.setTime(date);
return rvalue;
}