Skip to content

Instantly share code, notes, and snippets.

View bkleinen's full-sized avatar

Barne Kleinen bkleinen

View GitHub Profile
@bkleinen
bkleinen / hugo-modules.md
Last active July 31, 2023 08:42
Hugo Modules Cheatsheet

Use Hugo Modules / Divide Hugo Page into modules

To divide a hugo page into modules resp. move a part of it into a module, three steps are needed:

  1. make site a module
  2. make part a module
  3. import part via site config.toml

for 1. + 2. : to convert anything into a go module, a go.mod file needs to be created with:

classDiagram

    AgingItem <|-- NormalItem
    AgingItem <|-- AgedBrie
    AgingItem <|-- BackstagePass
    
    class AgingItem{
 update(item)
@bkleinen
bkleinen / fragen.md
Last active April 29, 2017 08:17
Starting IMI-Maps with vagrant

http://imimaps-staging.dev-sector.net http://imimaps-production.dev-sector.net

in ci-cd/docker-deploy.rb steht das zentrale deployment-cmd das von travis ausgeführt wird:

      deploy_command = "scp -i id_rsa_#{environment} -o StrictHostKeyChecking=no docker-compose-#{environment}.yml docker-deploy@imimaps-#{environment}.dev-sector.net:~  && \
        ssh  -i id_rsa_#{environment} -o StrictHostKeyChecking=no docker-deploy@imimaps-#{environment}.dev-sector.net \"export TAG=#{tag}; docker-compose -f ~/docker-compose-#{environment}.yml\" up -d"
        system(deploy_command)
@bkleinen
bkleinen / gist:34297b7ee4317bd2b36b
Created December 29, 2015 23:19 — forked from anikalindtner/gist:9524950
Workshops/Mailinglists/Lists
@bkleinen
bkleinen / simple-git-branching-model.md
Last active December 9, 2015 15:27 — forked from jbenet/simple-git-branching-model.md
a simple git branching model

a simple git branching model

(This article is by Juan Bennet, https://gist.github.com/jbenet/ee6c9ac48068889b0912 ) - I just forked it to make sure it doesn't disappear for some reason.)

This is a very simple git workflow. It (and variants) is in use by many people. I settled on it after using it very effectively at Athena. GitHub does something similar; Zach Holman mentioned it in this talk.

Update: Woah, thanks for all the attention. Didn't expect this simple rant

@bkleinen
bkleinen / tn
Last active August 29, 2015 14:08
LSF Participant Extraction
#!/usr/bin/env ruby
# this scripts collects participant data from the "special info" list
# - mainly, it eliminates doublettes (students who have been rejected and applied again)
# and keeps only the most successful application
inputfile = ARGV[0]
outputfile = ARGV[1]
unless inputfile # && outputfile
puts "usage: tn.rb inputfile [outputfile]"
exit 1
@bkleinen
bkleinen / Next Random Student
Created October 8, 2013 13:27
Random numbers for IMI Project Assignment.
Fire up irb and copy those two lines:
number_of_students=19
s = Set.new; n = 0 ; s << 0
Then repeatedly call this to get the next student:
while (s.include? n) do n = rand(number_of_students)+1 end ; s << n ; puts s.inspect ; n
/**
* Enumeration class CommandWord - write a description of the enum class here
*
* @author (your name here)
* @version (version number or date here)
*/
public enum CommandWord
{
GO("go"), QUIT("quit"), HELP("help"), UNKNOWN("?");
@bkleinen
bkleinen / TaxTime.java
Created October 15, 2012 19:54
TaxTime
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
/*
* Created on 06.01.2006
*/
/**
* @author weberwu
@bkleinen
bkleinen / gist:3865155
Created October 10, 2012 11:55
Info3-Greenfoot
Download Greenfoot:
http://www.greenfoot.org/download
Szenarien:
http://www.swisseduc.ch/informatik/karatojava/greenfootkara/
http://www.swisseduc.ch/informatik/karatojava/greenfootkara/classes/greenfootkara-all-scenarios-v2.0.0.zip