Skip to content

Instantly share code, notes, and snippets.

View Tehnix's full-sized avatar
🌞
Enjoying the code...

Christian Kjær Tehnix

🌞
Enjoying the code...
View GitHub Profile
@Tehnix
Tehnix / Linear Widget.js
Last active April 12, 2024 23:33
Linear iOS/macOS widget using Scriptable
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: teal; icon-glyph: magic;
const LINEAR_API_KEY = "lin_api_....";
const WIDGET_SIZE = config.widgetFamily; // "small" | "medium" | "large"
const VIEW_ID = "....-....-....-...-....."; // Your Linear view ID.
const TEAM_ID = "LTI"; // Your Linear team ID.
const DEFAULT_ASSIGNEE = "displayName"; // Your Linear display name.
const DEFAULT_PROJECT = "....-....-....-...-....."; // The default project to create issues in.
const DEFAULT_STATUS = "Backlog"; // The default status to create issues with.
let
bootPkgs = import <nixpkgs> { };
ghcide-pkgs = import (builtins.fetchTarball
"https://github.com/hercules-ci/ghcide-nix/tarball/master") { };
# We use a patched fork of base-noprelude which is compatible with GHCJS.
base-noprelude-src = bootPkgs.fetchFromGitHub {
owner = "codetalkio";
repo = "base-noprelude";
rev = "00b9f86b788d5e3558846b292a6bf6b25816647b";
@Tehnix
Tehnix / nix-shell error
Created April 12, 2020 20:41
Output of `nix-shell --show-trace`
error: while evaluating the attribute 'NIX_GHC' of the derivation 'ghc-shell-for-miso-spa-0.1.0.0' at /nix/store/9r1vhvri4ba913g4vyg5jqrhg6pb9amn-source/pkgs/development/haskell-modules/make-package-set.nix:308:9:
while evaluating 'ghcWithPackages' at /nix/store/9r1vhvri4ba913g4vyg5jqrhg6pb9amn-source/pkgs/development/haskell-modules/make-package-set.nix:243:23, called from /nix/store/9r1vhvri4ba913g4vyg5jqrhg6pb9amn-source/pkgs/development/haskell
-modules/make-package-set.nix:299:18:
while evaluating 'withPackages' at /nix/store/9r1vhvri4ba913g4vyg5jqrhg6pb9amn-source/pkgs/development/haskell-modules/make-package-set.nix:116:18, called from /nix/store/9r1vhvri4ba913g4vyg5jqrhg6pb9amn-source/pkgs/development/haskell-mo
dules/make-package-set.nix:243:35:
while evaluating 'callPackageWith' at /nix/store/9r1vhvri4ba913g4vyg5jqrhg6pb9amn-source/lib/customisation.nix:108:35, called from /nix/store/9r1vhvri4ba913g4vyg5jqrhg6pb9amn-source/pkgs/development/haskell-modules/make-package-set.nix:11
6:28:
while evaluati
let
bootPkgs = import <nixpkgs> { };
ghcide-pkgs = import (builtins.fetchTarball
"https://github.com/hercules-ci/ghcide-nix/tarball/master") { };
# We use a patched fork of base-noprelude which is compatible with GHCJS.
base-noprelude-src = bootPkgs.fetchFromGitHub {
owner = "codetalkio";
repo = "base-noprelude";
rev = "00b9f86b788d5e3558846b292a6bf6b25816647b";
@Tehnix
Tehnix / CI.yml
Created March 30, 2020 21:21 — forked from FedericoPonzi/CI.yml
Ready to use Github workflow for cross-compiling a rust binary to many Linux architectures.
# Instruction + template repo: https://github.com/FedericoPonzi/rust-ci
name: CI
on:
pull_request:
push:
branches:
- master
tags:
- 'v*.*.*'
@Tehnix
Tehnix / nix-miso-macos-catalina.md
Last active May 14, 2020 20:29
Getting Nix and Miso set up on macOS Catalina

Setting up Nix

Following this thread on getting Nix set up on macOS Catalina, there's a few steps involved (assuming you have no /nix folder):

  1. Set up nix folder: echo 'nix' | sudo tee -a /etc/synthetic.conf

  2. Reboot for it to take effect

  3. Create an APFS volume for Nix (might need to use a different diskX number, check diskutil list for more):

sudo diskutil apfs addVolume disk1 APFSX Nix -mountpoint /nix

@Tehnix
Tehnix / .travis.yml
Created January 3, 2019 19:17 — forked from tonyday567/.travis.yml
A multi-ghc/cabal/stack haskell travis
language: haskell
dist: trusty
cache:
directories:
- $HOME/.cabal/packages
- $HOME/.cabal/store
- $HOME/.stack
- $TRAVIS_BUILD_DIR/.stack-work
@Tehnix
Tehnix / Test Assignment.md
Last active November 20, 2018 00:15
React.js test assignment

React.js test

Assignment

Your task is to create one-page application with list of devices and their details. Devices data are stored in 'devices.json' which should be loaded dynamically via http request.

The result should be uploaded to github. If you don't have a user yet, you might need to create one.

You should be able to fetch the device list directly from https://gist.githubusercontent.com/Tehnix/c9d53939b2ed600b321fed8e1898f3a7/raw/dfe7adaf6f73e320ae4ed42761d6b50cf25eb569/devices.json meaning you don't need to keep a server running.

@Tehnix
Tehnix / UsingHasConfig.hs
Created November 17, 2018 23:49
Problems with type inference, `HasAwsCredentials env String` and `Member (Reader env) effs`
#!/usr/bin/env stack
-- stack --resolver lts-12.16 script --package freer-simple --package lens
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE AllowAmbiguousTypes #-}
module Test where
@Tehnix
Tehnix / libHStext-icu issues.md
Last active July 21, 2018 22:51
libHStext-icu issues on macOS, usually while building HIE (or anything with yi-rope)

Problem

If you update ICU on macOS, some packages are dynamically linked against a specific version, but the older version might dissapear. You'll see this with something like,

$ stack --stack-yaml=stack-8.0.2.yaml install --extra-lib-dirs=/usr/local/opt/icu4c/lib --extra-include-dirs=/usr/local/opt/icu4c/include
...
HaRe-0.8.4.1: copy/register
brittany-0.11.0.0: copy/register
Progress 18/20