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
@gaearon
gaearon / 00-README-NEXT-SPA.md
Last active October 14, 2024 00:05
Next.js SPA example with dynamic client-only routing and static hosting

Next.js client-only SPA example

Made this example to show how to use Next.js router for a 100% SPA (no JS server) app.

You use Next.js router like normally, but don't define getStaticProps and such. Instead you do client-only fetching with swr, react-query, or similar methods.

You can generate HTML fallback for the page if there's something meaningful to show before you "know" the params. (Remember, HTML is static, so it can't respond to dynamic query. But it can be different per route.)

Don't like Next? Here's how to do the same in Gatsby.

@FedericoPonzi
FedericoPonzi / CI.yml
Last active May 4, 2024 07:19
Ready to use Github workflow for cross-compiling a rust binary to many Linux architectures.
# Instruction + template repo: https://github.com/FedericoPonzi/rust-ci
# Search and replace <YOUR_BINARY_NAME> with your binary name.
name: CI
on:
pull_request:
push:
branches:
- master
tags:
@ibaiul
ibaiul / Protonmail.md
Last active November 1, 2024 14:23
Configure the protonmail bridge linux client on CentOS server and Fedora

Protonmail on CentOS server

#protonmail #centos #fedora #linux

Before you start

Currently protonmail bridge for linux is distributed as part of an open beta program, but soon it will be made public (https://protonmail.com/bridge/install).

Consider that the bridge linux client requires a paid protonmail account to work.

Get the protonmail bridge linux installer

@tonyday567
tonyday567 / .travis.yml
Created December 12, 2018 11:02
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
@kubek2k
kubek2k / simple-binary-lambda-tutorial.md
Created December 1, 2018 22:50
Short tutorial on how to run any statically linked binary on lambda

Preamble

The introduction of Custom Runtimes has opened up new possibilities when it comes to the spectrum of languages that can be used in Amazon Lambda. This short document will show how to run virtually any statically linked binary on it. The example will cover a stack built Haskell project.

Preparations

@ohanhi
ohanhi / frp.md
Last active May 6, 2024 05:17
Learning FP the hard way: Experiences on the Elm language

Learning FP the hard way: Experiences on the Elm language

by Ossi Hanhinen, @ohanhi

with the support of Futurice 💚.

Licensed under CC BY 4.0.

Editorial note

@Tehnix
Tehnix / brew-up-system.sh
Last active December 7, 2023 18:55
Set up OS X with brew
#!/bin/sh
binaries=(
awscli
trash
tree
git
mosh
tmux
screen
zsh
#!/bin/sh
COMPUTER_NAME="tehnix"
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
@bitemyapp
bitemyapp / gist:8739525
Last active May 7, 2021 23:22
Learning Haskell
@Tehnix
Tehnix / The journey to unit testing in Python.md
Created August 5, 2013 23:36
A very shallow look at unit testing in python.

With TDD (test driven development) having so much traction in our day and age, I thought it would be highly relevant to explore the concept of unit testing and such.

The idea behind test driven development, is that you first write your tests for your code, and then you write the code. This way, you can constantly watch if the code passes the tests, meaning the implementation is complete. This also forces you to think about your code before you write it, often helping you in visualizing what needs to be done and how.

A little note though, I have limited experience writing actual tests, but do know a bit about the idea/concept behind TDD.

Python gives us the lovely unittest module, which makes unit testing easy. This is, in reality, all you need to get started, but we're gonna get nose, which extends unittest to make testing easier (as is said on their site).

You can install nose via easy_install: easy_install nose