Skip to content

Instantly share code, notes, and snippets.

View klaeufer's full-sized avatar
:octocat:

Konstantin Läufer klaeufer

:octocat:
View GitHub Profile
@klaeufer
klaeufer / tlatex.sh
Last active May 8, 2024 15:26
Converts a TLA+ source to a LaTeX snippet containing only the resulting tlatex environment
#!/bin/bash
# Copyright 2024 Konstantin Läufer <laufer AT cs.luc.edu>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@klaeufer
klaeufer / catfacts.json
Last active April 18, 2024 22:43
LUC COMP 141 Materials
[
{
"breed": "Abyssinian",
"country": "Ethiopia",
"origin": "Natural\/Standard",
"coat": "Short",
"pattern": "Ticked"
},
{
"breed": "Aegean",
@klaeufer
klaeufer / freedns.sh
Created February 16, 2024 18:30
Update FreeDNS entry to private IP address on Linux - run manually, on startup, or in cron
#!/bin/bash
PRIVATE_IP=$(ip addr show wlp0s20f3 | grep 'inet ' | awk '{print $2}' | cut -f1 -d'/')
curl https://freedns.afraid.org/dynamic/update.php?MY_FREEDNS_API_KEY\&address=$PRIVATE_IP
@klaeufer
klaeufer / http2ssh.sh
Created December 16, 2022 15:55
GitHub Classroom: replace HTTP access tokens with ssh
gsed -i 's/https:\/\/x-access-token:.*@github.com\//[email protected]:/' ./*/.git/config
@klaeufer
klaeufer / KLSigPipeFun.scala
Created September 11, 2022 22:37 — forked from gkthiruvathukal/KLSigPipeFun.scala
Tinkering with Konstantin's example
object KLSigPipeFun {
def main(args: Array[String]) = {
val lines = scala.io.Source.stdin.getLines()
val lineNumbers = Iterator.from(1)
val numberedLines = lineNumbers.zip(lines)
val okLines = numberedLines takeWhile { _ => !scala.sys.process.stdout.checkError() }
val outLines = okLines map { case (number, line) => println(number + ":" + line) }
println(outLines.length + " lines counted")
}
}
@klaeufer
klaeufer / HOWTO.md
Last active March 21, 2022 16:56
How to copy a GitHub Java project into your own workspace

How to copy a GitHub Java project into your own workspace

This brief howto discusses several ways to copy a GitHub Java project into your own workspace so you can edit, compile, and run/test it.

Method 1 (highly discouraged)

This method is highly discouraged because it is tedious and error-prone.

  1. Create a new project in your development environment, such as IntelliJ IDEA.
  2. For each file in the GitHub project you are copying, create a file in your new project, then copy and paste the contents of the original file to your local file.
addSbtPlugin("com.github.sbt" % "sbt-cpd" % "2.0.0")
addSbtPlugin("com.orrsella" % "sbt-stats" % "1.0.7")
addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.5.1")
addSbtPlugin("org.foundweekends" % "sbt-bintray" % "0.5.1")
addSbtPlugin("org.scalastyle" %% "scalastyle-sbt-plugin" % "1.0.0")
addSbtPlugin("com.github.sbt" % "sbt-findbugs" % "2.0.0")
//dependencyOverrides += "com.puppycrawl.tools" % "checkstyle" % "8.27"
@klaeufer
klaeufer / lab10.jsh
Last active April 22, 2020 20:51
Loyola COMP 271 Sample JShell History
class BTNode<E> {
public E data;
public BTNode<E> left;
public BTNode<E> right;
public BTNode(final E data, final BTNode<E> left, final BTNode<E> right) {
if (data == null) throw new IllegalArgumentException("data is null");
this.data = data;
this.left = left;
this.right = right;
}
@klaeufer
klaeufer / README.md
Last active March 21, 2022 17:55
Loyola COMP 271 GitHub account creation

Loyola COMP 271: GitHub-Based Project Workflow

Individual activity

Collaborate with your classmates on a conceptual level but do not share code. Submit individually.

Learning Objectives

  • Get started with Git source code management
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.