Skip to content

Instantly share code, notes, and snippets.

View sofusalbertsen's full-sized avatar

Sofus Albertsen sofusalbertsen

  • Eficode
  • Copenhagen
View GitHub Profile
import os
import subprocess
def get_git_history(repo_path):
# Get the list of commits, tags and branches from the repository
result = subprocess.run(['git', '-C', repo_path, 'log', '--oneline', '--graph', '--all'], stdout=subprocess.PIPE)
git_history = result.stdout.decode('utf-8')
# Split the history into a list of lines

Kære deltager.

Til dette kursus vil det være en stor hjælp hvis alle deltagere har installeret Git på forhånd. Gerne en nogenlunde ny version. Den nyeste for tiden hedder 2.24, men 2.18 eller 2.19 og frem burde ikke give problemer.

Windows: Download passende installer fra: https://git-scm.com/download/win

Mac: Enten Download fra: https://git-scm.com/download/mac eller brug Homebrew med “brew install git”.

Linux: vedledning til diverse distributioner kan findes på https://git-scm.com/download/linux

@sofusalbertsen
sofusalbertsen / Jenkinsfile.groovy
Last active August 10, 2017 08:14
You need to install the lockable resources plugin to get this script to work https://wiki.jenkins.io/display/JENKINS/Lockable+Resources+Plugin PLUS ssh agent plugin https://wiki.jenkins.io/display/JENKINS/SSH+Agent+Plugin
// Constants
// This is to ensure that a developer does not push to the wrong ready branch namespace.
TARGET_BRANCH_NAME = "master"
MERGE_BRANCH_PREFIX = "ready"
GIT_REPO= "GITREPO"
SSH_AGENT_ID="CREDENTIALS"
// State
inputSHA = "" // Why can't Jenkins tell me this?!
authorEmail = "none"
authorName = "none"
@sofusalbertsen
sofusalbertsen / flora_dl.sh
Last active January 8, 2017 18:57
Bash script to download the main flowers from flora danica.
#! /bin/bash
for b in 0{1..9} {10..51}
do
for i in 000{1..9} 00{10..99} 0{100..999} {1000..3099}
do
(wget "http://kb-images.kb.dk/online_master_arkiv/non-archival/DUP/floradanica/h$b/floradanica_$i/0,0,5000,5000/,2000/0/default.jpg" -O "$b$i.jpg";
)&
done
find . -name '*.jpg' -size 0 -print0 | xargs -0 rm

Practical things

Communication and coordination

  • Hard to figure out who was the responsible Chief in CPH ( at least for the Aarhus Crowd )
  • Missing communication with regards to Jans back, both Aarhus and Leif was trying to solve the issue
  • Aarhus was not informed that Lars would show up monday - until sunday afternoon at random - hard to plan around that :)

Branding

Sponsors

  • Hard to figure out who was the sponsor contact
{
"type": "object",
"oneOf" : [{
"properties": {
"id": {
"type": "string"
},
"prev": {
"type": "array",
"items": {
@sofusalbertsen
sofusalbertsen / EnvBuilder.java
Last active September 27, 2015 12:00
Env builder to change from local to OpenStack db. when in production.
/*
* Author: Sofus Albertsen
*
*/
import static org.eclipse.persistence.config.PersistenceUnitProperties.*;
import java.util.HashMap;
import java.util.Map;
public class EnvBuilder {
//I need to identify if i have send and email or not within a subject-keyed hashmap containing arraylist of Email messages
private ConcurrentHashMap<String, ArrayList<Message>> cleanOneWayCOnversations(
ConcurrentHashMap<String, ArrayList<Message>> conversations2) {
conversations2.forEach((k,v)->{
//every conversation
boolean meSender,meReciever;
meSender=false;
meReciever=false;