Skip to content

Instantly share code, notes, and snippets.

View joncol's full-sized avatar

Jonas Collberg joncol

View GitHub Profile
@joncol
joncol / CapsLockCtrlBackspace.ahk
Created January 3, 2017 08:15
Windows keyboard configuration, using AHK
g_LastCtrlKeyDownTime := 0
g_AbortSendBackSpace := false
g_ControlRepeatDetected := false
*CapsLock::
if (g_ControlRepeatDetected)
{
return
}
@joncol
joncol / anonymous-gist.clj
Last active March 22, 2019 13:59
Timed Clojure thingy
(def ^:private credentials-status-atom (atom nil))
(defn- credentials-status []
(when-not @credentials-status-atom
(reset! credentials-status-atom
{:status "awaiting_mobile_bankid_authentication"})
(future
(Thread/sleep 3000)
(reset! credentials-status-atom {:status "updating"}))
(future
@joncol
joncol / fortune500.ipynb
Created October 10, 2019 06:34
Jupyter notebook
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@joncol
joncol / salary.ipynb
Last active October 20, 2019 09:04
Skatteverket lönestatistik
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@joncol
joncol / math.ipynb
Last active October 29, 2019 08:36
Norwegian graphs
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@joncol
joncol / place-cider-test-report-window.el
Last active December 3, 2019 17:36
place-cider-test-report
(defun create-test-report-window (&rest _)
"Create window to show test report buffer, if one exists.
Place it to the right of the current window. If a window for the test report
buffer already exists, don't create a new one."
(when-let* ((buf (get-buffer cider-test-report-buffer)))
(unless (get-buffer-window buf)
(let ((buffer-window (split-window (selected-window)
(/ (window-width) 2)
'right)))
(set-window-buffer buffer-window buf)
@joncol
joncol / core.clj
Created December 16, 2019 16:09
hello-selenium
;; Project dependencies:
;; [org.seleniumhq.selenium/selenium-chrome-driver "3.141.59"]
;; [org.seleniumhq.selenium/selenium-java "3.141.59"]
(ns hello-selenium.core
(:gen-class)
(:import [org.openqa.selenium By WebDriver WebElement]
[org.openqa.selenium.chrome ChromeDriver]))
(defn -main []
@joncol
joncol / main.clj
Created January 10, 2020 08:31
No-exit
(ns nordea-deposits-scraping.main
(:gen-class)
(:require [clojure.spec.alpha :as s]
[clojure.tools.cli :refer [parse-opts]]
[clojure.tools.logging :as log]
[clojure.tools.logging.impl :as log-impl]
;; [duct.core :as duct]
nordea-deposits-scraping.app
[nordea-deposits-scraping.config :refer [read-config]]
nordea-deposits-scraping.postgres
@joncol
joncol / suggestion.clj
Last active June 25, 2020 09:53
pr-suggestion
(defn get-callback-success [request id]
(jdbc/with-db-transaction [db (-> request :opts :db)]
(let [config (-> request :opts :config)
boundaries (-> request :opts :boundaries)
merchant (:merchant boundaries)
mantis (:mantis boundaries)
deposit (db/get-deposit db {:id id})
identification (delay (db/get-identification db {:id id}))
withdrawal (delay (update-withdrawal! (:opts request) id))]
(cond
@joncol
joncol / gist:043b75f8fe5866c9c6c84ce8ad481aa6
Last active November 9, 2021 08:28
Basic NixOS configuration
{ config, pkgs, ... }:
{
imports =
[
./hardware-configuration.nix
];
boot.kernelPackages = pkgs.linuxPackages_latest;