Skip to content

Instantly share code, notes, and snippets.

View serpro69's full-sized avatar
🍵
breaking things when they work, so I can fix them later

Særgeir serpro69

🍵
breaking things when they work, so I can fix them later
View GitHub Profile
@tomwwright
tomwwright / gist:f88e2ddb344cf99f299935e1312da880
Last active September 3, 2024 06:20
Dell XPS 15 9560: Ubuntu 17.10 + Nvidia 384.90 + Nvidia Prime (No Bumblebee) https://medium.com/@tomwwright/better-battery-life-on-ubuntu-17-10-4588b7f72def
# perform a fresh install of Ubuntu 17.10
# upgrade the kernel to v4.13.10
mkdir ~/kernel-v4.13.10
cd ~/kernel-v4.13.10
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.13.10/linux-headers-4.13.10-041310_4.13.10-041310.201710270531_all.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.13.10/linux-headers-4.13.10-041310-generic_4.13.10-041310.201710270531_amd64.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.13.10/linux-image-4.13.10-041310-generic_4.13.10-041310.201710270531_amd64.deb
sudo dpkg -i *.deb
@root-talis
root-talis / InheritanceTypeIdResolver.java
Created September 8, 2017 09:06
Java Jackson automatic TypeIdResolver based on inheritance
/*
* Automatic inheritance type resolver for Jackson.
* @author root_talis<https://github.com/root-talis>
*
*
* Usage:
*
* @JsonTypeInfo(use = JsonTypeInfo.Id.CUSTOM, include = JsonTypeInfo.As.PROPERTY, property = "discriminator")
* @JsonTypeIdResolver(InheritanceTypeIdResolver.class)
* class Animal { // can be abstract or interface
@outofcoffee
outofcoffee / RestAssuredKotlin.md
Created July 25, 2017 20:07
DSL for using RestAssured with Kotlin

DSL for using RestAssured with Kotlin

Example

        given {
            on {
                get("/orders/123") itHas {
                    statusCode(404)
                }
@joyrexus
joyrexus / README.md
Last active December 30, 2024 01:37
collapsible markdown

collapsible markdown?

CLICK ME

yes, even hidden code blocks!

print("hello world!")
@ronau
ronau / Nextcloud-Pi3-Setup.md
Last active July 2, 2024 22:23
Nextcloud on Raspberry Pi 3 Setup

Nextcloud on Raspberry Pi 3 Setup

Tip

There is a new and up-to-date version of this gist (with focus on the Raspi setup part): https://gist.github.com/ronau/462731589c44f91bb4a3b7d30d277ecf

This manual describes how to setup a Raspberry Pi 3 with nginx, PHP 7.0, MariaDB and use it as a Nextcloud server. Strong TLS encryption with Let's Encrypt certificates is also used. Of course, Owncloud can be used instead of Nextcloud. As of February 2017, the installation instructions are basically the same.

@udalov
udalov / getKType.kt
Last active March 16, 2021 21:54
DEPRECATED example how to obtain KType instance from reified T. Please use "typeOf" since 1.3.40!
import java.lang.reflect.*
import kotlin.reflect.KClass
import kotlin.reflect.KType
import kotlin.reflect.KTypeProjection
import kotlin.reflect.KVariance
import kotlin.reflect.full.createType
// --- Interface ---
inline fun <reified T : Any> getKType(): KType =
@akashnimare
akashnimare / README.md
Last active October 16, 2024 18:49
A Beginners Guide to writing a Kickass README ✍

Project title

A little info about your project and/ or overview that explains what the project is about.

Motivation

A short description of the motivation behind the creation and maintenance of the project. This should explain why the project exists.

Build status

Build status of continus integration i.e. travis, appveyor etc. Ex. -

Build Status

Applied Functional Programming with Scala - Notes

Copyright © 2016-2018 Fantasyland Institute of Learning. All rights reserved.

1. Mastering Functions

A function is a mapping from one set, called a domain, to another set, called the codomain. A function associates every element in the domain with exactly one element in the codomain. In Scala, both domain and codomain are types.

val square : Int => Int = x => x * x
@HaleTom
HaleTom / print256colours.sh
Last active April 28, 2025 10:09
Print a 256-colour test pattern in the terminal
#!/bin/bash
# Tom Hale, 2016. MIT Licence.
# Print out 256 colours, with each number printed in its corresponding colour
# See http://askubuntu.com/questions/821157/print-a-256-color-test-pattern-in-the-terminal/821163#821163
set -eu # Fail on errors or undeclared variables
printable_colours=256