Skip to content

Instantly share code, notes, and snippets.

View dmalikov's full-sized avatar
🥞
!

Dmitry Malikov dmalikov

🥞
!
View GitHub Profile
@dmalikov
dmalikov / er
Created November 6, 2012 16:46
git wat
$> git pull --rebase origin master
usage: git merge-base [-a|--all] <commit> <commit>...
or: git merge-base [-a|--all] --octopus <commit>...
or: git merge-base --independent <commit>...
-a, --all output all common ancestors
--octopus find ancestors for a single n-way merge
--independent list revs not reachable from others
usage: git merge-base [-a|--all] <commit> <commit>...
@dmalikov
dmalikov / br.rb
Created November 7, 2012 18:37
INFINITE SYMBOL MADE OF COLONS
irb(main):014:0> class Symbol
irb(main):015:1> def append( x ) (self.to_s << x.to_s).to_sym end
irb(main):016:1> end
=> nil
irb(main):017:0> def us ( n ) Enumerator.new { |list| x = :":"; loop { x = x.append(:":"); list << x } }.take(n)[n-1] end
=> nil
irb(main):018:0> us(10000)
=> :":::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Data/Array/Repa/Algorithms/Matrix/Boolean.hs:28:3:
Couldn't match type `Array r3 ((Z :. Int) :. Int) e1'
with `CDL l => Array U DIM2 l'
Expected type: m (Matrix l)
Actual type: m (Array r3 ((Z :. Int) :. Int) e1)
In a stmt of a 'do' block:
computeP
$ fromFunction (Z :. h1 :. w2)
$ \ ix
-> joinAllS
@dmalikov
dmalikov / px.hs
Created November 22, 2012 18:51
part of xmonad.hs
main :: IO ()
main = do
initCapturing
xmproc <- spawnPipe xmobar_run
xmonad $ defaultConfig
{ borderWidth = 7
, focusFollowsMouse = False
, focusedBorderColor = orangeDarkestColor
, keys = liftM2 union myKeys (keys defaultConfig)
, layoutHook = myLayoutHook
@dmalikov
dmalikov / gist:4191299
Created December 2, 2012 22:14
liblastfm failed :[
> updateNowPlaying (Artist "Amenra") (Track "Némelèndèlle") Nothing Nothing Nothing Nothing Nothing Nothing ak sk s
Loading package tagged-0.4.4 ... linking ... done.
Loading package pretty-1.1.1.0 ... linking ... done.
Loading package array-0.4.0.1 ... linking ... done.
Loading package deepseq-1.3.0.1 ... linking ... done.
Loading package bytestring-0.10.0.0 ... linking ... done.
Loading package containers-0.5.0.0 ... linking ... done.
Loading package text-0.11.2.3 ... linking ... done.
Loading package attoparsec-0.10.2.0 ... linking ... done.
Loading package blaze-builder-0.3.1.0 ... linking ... done.
@dmalikov
dmalikov / Adda2Week1PrimMST.hs
Created December 3, 2012 23:34
ADAA2 Week 1
{-# LANGUAGE UnicodeSyntax #-}
module Adda2.Week1.PrimMST where
import Control.Applicative (many, (<$>), (<*))
import Control.Monad (replicateM)
import Data.List (nub, sort)
import Data.Attoparsec.Text.Lazy
import Data.Text.Lazy.IO as T
@dmalikov
dmalikov / Capfile.rb
Created December 7, 2012 22:46
deploy liblastfm haddocks to budueba.com
# Deploying haddocks
#
# cap deploy:haddocks
load 'deploy'
ssh_options[:forward_agent] = true
after "deploy:create_symlink", "deploy:cleanup"
@dmalikov
dmalikov / BF.hs
Last active December 10, 2015 18:09
ADAA2 Week 4 (Bellman-Ford + Dijkstra)
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE UnicodeSyntax #-}
import Control.Applicative (many, (<$>), (<*))
import Control.Lens
import Data.Attoparsec.Text.Lazy
import qualified Data.HashMap.Strict as M
import Data.List (nub, sort)
import Data.Text.Lazy.IO as T
import qualified Algo.BellmanFord as BF
@dmalikov
dmalikov / build.sm
Last active May 17, 2020 20:23
Programming Languages assignment 1 (with smbt and qcheck)
target hw1
sources
hw1.mlb
hw1.main.sml
end
option compiler = mlton
option output = hw1
end
@dmalikov
dmalikov / week02.sml
Last active December 12, 2015 00:58
Programming Languages Homework 2
(* routines *)
fun map f (x::xs) = f x :: map f xs
| map _ [] = []
fun concat (x::xs) = x @ concat xs
| concat [] = []
fun mapPartial _ [] = []
| mapPartial f (x::xs) = case f x
of SOME v => v :: (mapPartial f xs)