Skip to content

Instantly share code, notes, and snippets.

View shouya's full-sized avatar

shouya

View GitHub Profile
------------ (
I will show you how to translate lojban into English.
Lojban: coi rodo
English: Hi, everyone.
Lojban: mi citka lo plise
English: I eat the apple.
Lojban: lo plise cu se cikta mi
@shouya
shouya / lo-balmle-tamca.md
Last active September 7, 2020 18:44
loi selsa'a bau lo jbobau

ni'o loi balmle tamca

i lo xadni poi tolpinta je melbi

gi'e lo se dasni poi xunre

gi'e lo panci poi slari je titla

cu se ckaji loi balmle tamca i loi tamca

Composition of Functors/Applicatives/Monads*

Functor

A functor is a map between categories.

fmap :: (Functor f) => (a -> b) -> f a -> f b
@shouya
shouya / keybase.md
Created February 13, 2020 18:12
Keybase Proof

Keybase proof

I hereby claim:

  • I am shouya on github.
  • I am shou (https://keybase.io/shou) on keybase.
  • I have a public key ASCmnqGO0FcviJ7Q-dUi3MxM1lTtvAbw38gGLA-HqITCmQo

To claim this, I am signing this object:

@shouya
shouya / Lens.hs
Created October 21, 2019 08:30
Proof that (s -> a, s -> b -> t) is indeed isomorphic to forall f. Functor f => (a -> f b) -> (s -> f t)
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE TypeSynonymInstances #-}
{-# LANGUAGE InstanceSigs #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FunctionalDependencies #-}
@shouya
shouya / prng.hs
Created August 30, 2019 10:15
quick & dirty PRNG
rnd = 123:map (\x -> (1664525 * x + 1013904223) `mod` 65536) rnd
@shouya
shouya / x.ruleset
Last active January 15, 2019 15:29
uMatrix ruleset
! uMatrix: Ruleset recipes 1.0
! Title: Shou's Ruleset
! Maintainer: Shou Ya
! CDN
* ajax.googleapis.com script allow
* cdn.bootcss.com script allow
* cdn.ravenjs.com script allow
* cdn.sstatic.net script allow
* cdnjs.cloudflare.com script allow
1. drivers in lspci -k
2. bluetooth
3. wireless
4. docker
5. cpu scheduler
6. bbr
7. systemd
8. coretemp
9. ext2 & ext3
10. acpi (https://wiki.gentoo.org/wiki/Power_management/Guide)
@shouya
shouya / cracked_163_webapi_encryption.js
Last active December 5, 2017 10:53
Having fun with crossword games!
// extracted from: https://s3.music.126.net/sep/s/2/core.js
// rsa.e: exp
// rsa.m: modulus
function modpow(rsa, str) {
for (var f, g, h, i, j, k, l, c = new Array, d = str.length, e = 0; d > e; ) {
c[e] = str.charCodeAt(e);
e++;
for (; 0 != c.length % a.chunkSize; ) {
c[e++] = 0;
@shouya
shouya / 1_numpy_net.ipynb
Last active July 11, 2017 10:40
plain numpy, torch.autograd and torch.nn implementation of a simple nn
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.