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 / _lib sqs.ts
Created December 16, 2024 08:59
CDK for IoT Data Ingestion
import * as cdk from 'aws-cdk-lib';
import * as sqs from 'aws-cdk-lib/aws-sqs';
import { Construct } from 'constructs';
interface StackProps extends cdk.StackProps {
/**
* The name of the queue.
*/
readonly queueName: string;
@Tehnix
Tehnix / Linear Widget.js
Last active December 17, 2024 01:48
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