This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
maksenov@supki-laptop:~/playground/tar% time ./Main > /dev/null | |
./Main > /dev/null 0.16s user 0.09s system 99% cpu 0.250 total | |
maksenov@supki-laptop:~/playground/tar% time ./a.out > /dev/null | |
./a.out > /dev/null 0.01s user 0.03s system 98% cpu 0.037 total |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE MultiParamTypeClasses #-} | |
{-# LANGUAGE OverlappingInstances #-} | |
module Just where | |
class Just a b where | |
collapse :: Maybe a -> Maybe b | |
instance Just a a where | |
collapse = id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# OPTIONS_GHC -W #-} | |
module Format where | |
import Control.Applicative (Applicative(..), Alternative(..), liftA2) | |
import Data.Foldable (asum) | |
import Data.Semigroup | |
infixr 4 :+: | |
-- | AST for formats: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE MultiParamTypeClasses #-} | |
{-# LANGUAGE TypeFamilies #-} | |
{-# LANGUAGE TemplateHaskell #-} | |
{-# OPTIONS_GHC -W #-} | |
module Mip where | |
import Control.Applicative (Applicative(..)) | |
import qualified Control.Lens as L | |
import Control.Lens.Operators |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
maksenov@supki-laptop:~/git/biegunka% g log -10 --oneline origin/develop | |
dbdec92 7.6.2 (?) bug fix. | |
1b096de Rewrite 'check' interpreter. | |
4aa1c23 Add a bit of doctests. | |
89b1006 Fix specs. | |
504c900 Update biegunka init template | |
c9f230f Cleverer TH. | |
6a3e4de Remove Mode. | |
8001860 Work with directories as path for `biegunka init`. | |
c80072a Swap retries/reacting in docs. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
# -*- coding: utf-8 -*- | |
class Function | |
attr_reader :block | |
def initialize &block | |
@block = block | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
# $branch supposedly points to previous git branch | |
function git-checkout-back () | |
{ | |
git checkout "${branch}" | |
} | |
echo -e "\n * Generating docs..\n" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE LambdaCase #-} | |
{-# OPTIONS_GHC -fno-warn-incomplete-patterns #-} | |
module Partial where | |
import Control.Exception (PatternMatchFail, catch, evaluate) | |
import Data.Maybe (mapMaybe) | |
import System.IO.Unsafe (unsafePerformIO) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
# Try to increment first regex match in file | |
vimregex=$1 | |
filename=$2 | |
vim -es -u NONE \ | |
-c "${vimregex}" \ | |
-c ':normal ' \ | |
-c ':wq' "${filename}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# -*- coding: utf-8 -*- | |
def f | |
s = gets.chomp | |
z = Class.new | |
z.class_eval do | |
define_method :ma do | |
s * 2 |