Skip to content

Instantly share code, notes, and snippets.

View phdoerfler's full-sized avatar

Philipp Dörfler phdoerfler

View GitHub Profile
@yannhowe
yannhowe / .gitlab.ci.yml
Created September 26, 2016 18:06
.gitlab.ci.yml for SSH with private key.
# Image neeeds to have ssh-client
image: docker:git
services:
- docker:dind
stages:
- staging
before_script:
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY
@kpmeen
kpmeen / TablePrinter.scala
Last active March 5, 2022 12:52
Scala code for generating an ASCII table for a given data set. The implementation handles ANSI colours by depending on Fansi (https://github.com/lihaoyi/fansi) by Li Haoyi.
import fansi.Str
import org.slf4j.LoggerFactory
import scala.util.Try
import scala.util.control.NonFatal
object TablePrinter {
val logger = LoggerFactory.getLogger(TablePrinter.getClass)

Thread Pools

Thread pools on the JVM should usually be divided into the following three categories:

  1. CPU-bound
  2. Blocking IO
  3. Non-blocking IO polling

Each of these categories has a different optimal configuration and usage pattern.

@Piasy
Piasy / install_ffmpeg.sh
Last active March 16, 2025 19:14
brew install ffmpeg with all options
brew options ffmpeg
brew install ffmpeg \
--with-chromaprint \
--with-fdk-aac \
--with-fontconfig \
--with-freetype \
--with-frei0r \
--with-game-music-emu \
--with-libass \
@YordanGeorgiev
YordanGeorgiev / logback.example.xml
Last active April 18, 2024 11:06
[minimal-logback.xml-example] how-to configure the logback.xml minimalistically #scala #xml #logback #logging #configuration
<!-- all you need to know about log levels src: https://i.stack.imgur.com/Z5mag.png -->
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<logger name="com.datastax.driver.core.QueryLogger.SLOW" level="DEBUG" />
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern> %d{yyyy-MM-dd HH:mm:ss.SSS} [%level] %msg %n</pattern>
</encoder>
</appender>
@bittner
bittner / keyboard-keys.md
Created February 28, 2019 22:50
Keyboard keys markup in MarkDown

Ctrl + Alt + Space

@normoes
normoes / get_files_and_info_from_docker_container.md
Created March 1, 2019 15:12
Get files and information from a docker container

This can be used to retreive files/binaries/information from docker containers.

#!/bin/bash

set -Eeuo pipefail

mkdir ./binary || true

# build most recent docker image
@sdondley
sdondley / tmux split-window subcommand.md
Last active April 24, 2025 13:56
Super Guide to the split-window tmux Subcommand (and Beyond)

Super Guide to the split-window tmux Subcommand (and Beyond)

Guide overview

tmux, like other great software, is deceptive. On the one hand, it's fairly easy to get set up and start using right away. On the other hand, it's difficult to take advantage of tmux's adanced features without spending some quality alone time with the manual. But the problem with manuals is that they aren't geared toward beginners. They are geared toward helping seasoned developers and computer enthusiasts quickly obtain the

@guilgaly
guilgaly / 1 - scalac options 2.13.scala
Last active June 2, 2024 19:50
Scala compiler options I typically use
val scalacOptions = Seq(
"-encoding",
"utf-8", // Specify character encoding used by source files.
"-Ybackend-parallelism", //
"8",
"-explaintypes", // Explain type errors in more detail.
"-feature", // Emit warning and location for usages of features that should be imported explicitly.
"-unchecked", // Enable additional warnings where generated code depends on assumptions.
"-Xcheckinit", // Wrap field accessors to throw an exception on uninitialized access.
// "-Ymacro-annotations", // Enable support for macro annotations, formerly in macro paradise.
@seyonv
seyonv / Focusmate_num_sessions_v1.rb
Last active January 19, 2022 15:08
File to get the current total number of sessions in Focusmate
require 'json'
require 'pry'
require 'uri'
require 'net/http'
class FocusMateNumSessions
# Step 1. Create a file somewhere in your filesystem.
# Call it fm_token_file.txt. Insert the path to the file into the line below
# Make sure to look at the reference .txt file and just paste
# that over.