Skip to content

Instantly share code, notes, and snippets.

View ibacklight.hs
#!/usr/bin/env nix-shell
#! nix-shell -i runhaskell -p "haskellPackages.ghcWithPackages (pkgs: [pkgs.shqq])"
{-# LANGUAGE QuasiQuotes #-}
import System.ShQQ (sh)
import System.Environment (getArgs)
parseOp :: Num a => Char -> a -> a -> a
parseOp '+' = (+)
parseOp '-' = (-)
View map_game.c
#include <stdio.h>
#include <wchar.h>
#include <locale.h>
#include <stdlib.h>
#include <termios.h>
#include <unistd.h>
static int MapSizeRow = 10 + 2; //map size with boundaries in vertical direction
static int MapSizeCol = 20 + 2; //map size with boundaries in horizontal direction
View tcp_client.hs
-- Message -> State -> State
measure updateRecv :: Int -> Int -> Int
measure updateSend :: Int -> Int -> Int
undefined as rforall a. a
undefined = 0
assert :: {v:Bool | v} -> Unit
assert = \tru -> Unit
View twoPhaseCommit.hs
-- tick and tock with session types in Mist
-- Message -> State -> State
measure updateRecv :: Int -> Int -> Int
measure updateSend :: Int -> Int -> Int
undefined as rforall a. a
undefined = 0
assert :: {v:Bool | v} -> Unit
View asdf.hs
{-# LANGUAGE TypeFamilies, DeriveFunctor #-}
module Expr where
import Data.Functor.Foldable
data ExprF a
= ConstF Double
| AddF a a
| SubF a a
| MulF a a
View userChrome.css
#toolbar-menubar[inactive] + #TabsToolbar {
//visibility: collapse;
}
#sidebar-box[sidebarcommand="treestyletab_piro_sakura_ne_jp-sidebar-action"] #sidebar-header {
display: none;
}
splitter {
padding: 5px;
View userChrome.css
/* Hide various elements */
#back-button[disabled = "true"],
#forward-button[disabled = "true"],
#new-tab-button,
.scrollbutton-down,
.scrollbutton-up
{ display: none !important; }
/* Hide splitter, when using Tree Style Tab. */
#sidebar-box[sidebarcommand="treestyletab_piro_sakura_ne_jp-sidebar-action"] + #sidebar-splitter {
View .vimrc
" vim: foldmethod=marker foldlevel=0
" {{{ Plugins
if has("nvim") | let path=$HOME."/.config/nvim/autoload/plug.vim"
else | let path=$HOME."/.vim/autoload/plug.vim"
endif
function! MyOnBattery()
if filereadable("/sys/class/power_supply/ADP0/online")
return readfile('/sys/class/power_supply/ADP0/online') == ['0']
endif
View ibacklight.hs
#!/usr/bin/env nix-shell
#! nix-shell -i runhaskell -p "haskellPackages.ghcWithPackages (pkgs: [pkgs.shqq])"
{-# LANGUAGE QuasiQuotes #-}
import System.ShQQ (sh)
import System.Environment (getArgs)
parseOp :: Num a => Char -> a -> a -> a
parseOp '+' = (+)
parseOp '-' = (-)
View bf.vim
" vim: set virtualedit=all:
" The following line is the macro that executes one step.
`b"ayl`a/^aW"ay$'c@a`blmbmb
" Set marks a,b,c at the second char of the 1st, 2nd,
" and 3rd blank lines respectively, and then enjoy!
+ 
- 
> jmc