Skip to content

Instantly share code, notes, and snippets.

@jrudolph
jrudolph / raspberry-pi.md
Last active January 22, 2022 12:24
Scala Native for Raspberry Pi 1

Here's a quick report that I used this branch to compile a binary for Raspberry Pi 1 using https://github.com/scala-native/scala-native/commit/18114562b28e9301c944f7e142ac92d7edd1058c from scala-native/scala-native#1571.

In a quest to update my daughter's music box based on a Raspberry Pi 1, I tried to use scala-native instead of a regular OpenJDK for running the custom software.

Ultimately, I got something working but it was quite a rocky road (and I'm not sure if I would recommend it instead of using Zulu OpenJDK). As mentioned before somewhere in the PR I had to change NativeConfig to default to a 32-bit architecture.

I'm using this config on the project:

nativeCompileOptions ++= Seq("-target", "arm-linux-gnueabihf", "-fno-builtin", "-fno-exceptions", "-march=armv6", "-v")
@Simhyeon
Simhyeon / .Xmodmap
Last active September 17, 2022 08:26
Xmodmap example
! # NOTE
!
! For asian users, this keymappings will not work when typing in your native
! language. You need a separate article to understand why that doesn't work,
! yet you can use keyd or kmonad if you need low-level global key mapping.
! I personally recommend using keyd if you are not familar with lisp-like
! languages.
!
! - Keyd repository : https://github.com/rvaiya/keyd
! - My config for keyd : https://gist.github.com/Simhyeon/58b008a9a5d8e8b34d78d774db1f745b
@bblfish
bblfish / PointedGraph.scala
Created August 24, 2020 15:44
Trying to get the types in dotty to line up.
package org.w3.banana
import org.w3.banana._
trait RDFOps[Rdf <: RDF & Singleton](using val Rdf: RDF) {
def emptyGraph: Rdf.Graph
}
trait PointedGraph[Rdf <: RDF & Singleton](using val ops: RDFOps[Rdf]) {
@travisbrown
travisbrown / response-de-goes.md
Last active March 31, 2024 14:41
Response to cease and desist letter from John A. De Goes, CEO of Ziverge
@markehammons
markehammons / build.sbt
Created December 19, 2018 04:22
Packaging your application with a minimized runtime courtesy of jlink
import java.io.{ByteArrayOutputStream, PrintWriter}
import java.util.spi.ToolProvider
enablePlugins(JavaAppPackaging)
//this allows us to run tools like jdeps and jlink from within the JVM
def runTool(name: String, arguments: Seq[String]): Either[String,String] = {
val maybeTool: Option[ToolProvider] = {
val _tool = ToolProvider.findFirst(name)
if(_tool.isPresent) {
@andy0130tw
andy0130tw / 50-fira-sans-tnum.conf
Last active February 8, 2021 23:26
Turn on an OpenType feature for Fira Sans through fontconfig for tabular figures, making it a nicer UI font. Perfect for Pop!_OS.
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<match target="font">
<test qual="any" name="family">
<string>Fira Sans</string>
</test>
<edit name="fontfeatures" mode="prepend">
<string>tnum</string>
</edit>
import scala.language.existentials
class A { class E }
class B extends A { class E }
trait CD { type E }
trait C extends CD { type E = Int }
trait D extends CD { type E = String }
object Test {
type EE[+X <: { type E }] = X#E
@joyeusenoelle
joyeusenoelle / Mastodon.md
Last active January 23, 2024 02:43
An increasingly less-brief introduction to Mastodon
@genkuroki
genkuroki / Monte Carlo simulation of the 2D Potts model - Part 2.ipynb
Last active June 21, 2023 22:12
Julia/Ising/Monte Carlo simulation of the 2D Potts model - Part 2.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.