Skip to content

Instantly share code, notes, and snippets.

View jkpl's full-sized avatar

Jaakko Pallari jkpl

View GitHub Profile
@jkpl
jkpl / U.S. International wo dead keys.keylayout
Created March 9, 2022 07:00
U.S. International w/o dead keys keyboard layout for Mac
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE keyboard PUBLIC "" "file://localhost/System/Library/DTDs/KeyboardLayout.dtd">
<!--Last edited by Ukelele version 2.0.1 on 2010-08-26 at 17:40 (GMT+02:00)-->
<keyboard group="0" id="2" name="U.S. International w/o dead keys" maxout="1">
<layouts>
<layout first="0" last="17" modifiers="f4" mapSet="16c"/>
<layout first="18" last="18" modifiers="f4" mapSet="994"/>
<layout first="21" last="23" modifiers="f4" mapSet="994"/>
<layout first="30" last="30" modifiers="f4" mapSet="994"/>
<layout first="194" last="194" modifiers="f4" mapSet="994"/>
param (
[Parameter(Mandatory=$false)]
[switch]$Disable
)
$script:regKeyPath = "HKLM\SYSTEM\CurrentControlSet\Control\DeviceGuard\Scenarios\HypervisorEnforcedCodeIntegrity"
If ($Disable) {
Write-Host "Disabling HyperV"
bcdedit /set hypervisorlaunchtype off
@jkpl
jkpl / eap-ttls-pap
Created February 1, 2013 18:46
Wicd template for Eduroam networks (this should work on Univesity of Jyväskylä's jyu-student and jyu-staff networks).
name = EAP-TTLS-PAP
author = jkpl
version = 1
require identity *Identity password *Password
optional ca_cert *Path_to_CA_cert anon_identity *Anonymous_Identity
protected password *Password
-----
ctrl_interface=/var/run/wpa_supplicant
network={
ssid="$_ESSID"
@jkpl
jkpl / ResponseCollector.scala
Last active October 20, 2020 10:13
Reusable response collector in Akka
package collector
import akka.actor._
import akka.util.Timeout
import scala.concurrent.duration._
import scala.concurrent.{Future, Promise}
trait ResponseTracker[T] {
def addResponse(response: T): ResponseTracker[T]
def isDone: Boolean
@jkpl
jkpl / freefrp.js
Last active May 7, 2020 07:27
Free monad based thread simulation and FRP constructs written in JavaScript. http://stuff.lepovirta.org/r/freefrp/
// Free monad based thread simulation and FRP constructs written in JavaScript
// First, we need some way to express lazy values and actions.
// We can use zero-argument functions for this purpose: call the function and
// you get the value. We also need to compose lazy values/actions. For that
// we have bindLazy function. Lazy values are not expected to be pure
// in this program: evaluating a lazy value/action at different times can produce
// a different value.
@jkpl
jkpl / keybase.md
Last active April 1, 2019 18:12
keybase.md

Keybase proof

I hereby claim:

  • I am jkpl on github.
  • I am jkpl (https://keybase.io/jkpl) on keybase.
  • I have a public key ASA3n-ICY3CrHvBEUoW3UG4vA3md_9RKyDFL3AT30KJAswo

To claim this, I am signing this object:

@jkpl
jkpl / Main.scala
Created January 8, 2018 15:43
Dropwizard Graphite demo for Scala
package dwgraphitedemo
import java.lang.management.ManagementFactory
import java.util.concurrent.TimeUnit
import com.codahale.metrics.graphite.{Graphite, GraphiteReporter}
import com.codahale.metrics.SharedMetricRegistries
import com.codahale.metrics.jvm._
import com.twitter.finagle.http.{Request, Response, Status}
import com.twitter.finagle.{Http, Service}
@jkpl
jkpl / bootstrap.sh
Last active November 29, 2017 22:04
Fedora bootstrap
#!/bin/bash
dnf --refresh upgrade
dnf install --nogpgcheck \
http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm \
http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
dnf --refresh groupinstall "Development Tools"
dnf install $(grep fedora_packages.txt -v -e '^#' -e '^$' | tr '\n' ' ')
@jkpl
jkpl / fasttrack.clj
Last active February 25, 2017 23:48
Reaktor Fast Track in Clojure
(ns jkpl.fasttrack
(:require [clojure.string :as s]
[clojure.java.io :as io]))
(defn string-to-numbers
"Converts string of numbers to a list of numbers"
[s]
(->> (s/split s #" ")
(map read-string)))
@jkpl
jkpl / altfin.keylayout
Created February 25, 2017 23:46
My old keyboard layout for OS X (Ukelele format)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE keyboard PUBLIC "" "file://localhost/System/Library/DTDs/KeyboardLayout.dtd">
<!--Last edited by Ukelele version 2.2.4 on 2013-02-08 at 22:01 (UTC+2.00)-->
<keyboard group="0" id="5591" name="AltFin" maxout="1">
<layouts>
<layout first="0" last="17" modifiers="f4" mapSet="16c"/>
<layout first="18" last="18" modifiers="f4" mapSet="984"/>
<layout first="21" last="23" modifiers="f4" mapSet="984"/>
<layout first="30" last="30" modifiers="f4" mapSet="984"/>
<layout first="194" last="194" modifiers="f4" mapSet="984"/>