Skip to content

Instantly share code, notes, and snippets.

View ahaxu's full-sized avatar

AhaXu ahaxu

View GitHub Profile
/** Turbo Plutus 🔥
* an easy to use library for smart contract generation with NO learning curve
*
* example usage:
* ```ts
* import makeSmartContract from "Turbo_Plutus🔥.ts"
*
* const shotMyselfInTheFootContract = makeSmartContract();
* ```
*
@KtorZ
KtorZ / ManagedDelegation.hs
Created April 14, 2022 22:31
A Plutus smart-validator "that allows one to stake & then send the interest to an address other than the principal’s address".
-- | ⚠️ IMPORTANT
--
-- This code is UNTESTED and UNLICENSED. Use at your own risk and do whatever
-- you want with it.
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeApplications #-}
module Plutus.ManagedDelegation where
@andypiper
andypiper / ish-apks.txt
Last active February 4, 2024 18:27
Setup iSH / Alpine Linux on iPad
# edit the login message
vi /etc/motd
# switch to usable repos - iSH defaults often failed with EOF errors
echo https://dl-cdn.alpinelinux.org/alpine/v3.13/main > /etc/apk/repositories
echo https://dl-cdn.alpinelinux.org/alpine/v3.13/community >> /etc/apk/repositories
# install some basics
apk add zsh bash
apk add sed attr dialog dialog-doc bash bash-doc bash-completion grep grep-doc
@andrebrait
andrebrait / keychron_linux.md
Last active May 30, 2024 19:06
Keychron keyboards on Linux + Bluetooth fixes

Here is the best setup (I think so :D) for K-series Keychron keyboards on Linux.

Note: many newer Keychron keyboards use QMK as firmware and most tips here do not apply to them. Maybe the ones related to Bluetooth can be useful, but everything related to Apple's keyboard module (hid_apple) on Linux, won't work. As far as I know, all QMK-based boards use the hid_generic module instead. Examples of QMK-based boards are: Q, Q-Pro, V, K-Pro, etc.

Most of these commands have been tested on Ubuntu 20.04 and should also work on most Debian-based distributions. If a command happens not to work for you, take a look in the comment section.

Make Fn + F-keys work (NOT FOR QMK-BASED BOARDS)

Older Keychron keyboards (those not based on QMK) use the hid_apple driver on Linux, even in the Windows/Android mode, both in Bluetooth and Wired modes.

@dino-
dino- / string-conversions.hs
Last active May 26, 2024 02:17
A handy illustration of converting between String, Text and ByteString in Haskell
#! /usr/bin/env stack
-- stack --resolver lts-18.8 script
{-# LANGUAGE OverloadedStrings #-}
{-
This is a handy illustration of converting between five of the commonly-used
string types in Haskell (String, ByteString, lazy ByteString, Text and lazy
Text).
@CMCDragonkai
CMCDragonkai / higher_kinded_types_in_rust_and_haskell.md
Last active April 15, 2024 16:50
Rust/Haskell: Higher-Kinded Types (HKT)

Rust/Haskell: Higher-Kinded Types (HKT)

A higher kinded type is a concept that reifies a type constructor as an actual type.

A type constructor can be thought of in these analogies:

  • like a function in the type universe
  • as a type with a "hole" in it
@sacundim
sacundim / Shape.hs
Last active March 31, 2022 14:01
OOP Shape example in Haskell, using existentials, GADTs, Typeable and ConstraintKinds to support downcasts.
{-# LANGUAGE GADTs, ConstraintKinds, KindSignatures, DeriveDataTypeable #-}
{-# LANGUAGE TypeOperators, ScopedTypeVariables, FlexibleInstances #-}
module Shape where
import Control.Applicative ((<$>), (<|>))
import Data.Maybe (mapMaybe)
import Data.Typeable
import GHC.Exts (Constraint)
@hvoecking
hvoecking / translate.go
Last active March 28, 2024 13:52
Golang reflection: traversing arbitrary structures
// Traverses an arbitrary struct and translates all stings it encounters
//
// I haven't seen an example for reflection traversing an arbitrary struct, so
// I want to share this with you. If you encounter any bugs or want to see
// another example please comment.
//
// The MIT License (MIT)
//
// Copyright (c) 2014 Heye Vöcking
//
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 31, 2024 22:29
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname