Skip to content

Instantly share code, notes, and snippets.

@0rca
0rca / .zshrc
Created December 21, 2012 06:13
initializing rbenv with --no-rehash option saves me 0,5s on new terminal session start-up
if which rbenv > /dev/null; then eval "$(rbenv init - --no-rehash)"; fi
@0rca
0rca / .zshrc
Last active December 3, 2015 18:34
Poor man's VPN
alias vpn='while true; do ssh -N -D 127.0.0.1:1080 yoursitenamehere.com; done'
@0rca
0rca / test4.clj
Last active August 29, 2015 14:12
(defn numseq []
(->> (range) (map inc) (map #(.toString %)) (map seq) (flatten)))
(defn positions-of [el s]
(let [el' (-> el .toString seq)]
(->> s
(partition (count el') 1)
(map-indexed vector)
(filter (fn [[i x]] (= x el')))
(map (comp inc first)))))
import Data.List
numseq = concatMap show [1..]
findFirst a = fmap (+ 1) $ findIndex (isPrefixOf a) (tails xs) where
xs = numseq
module NewModule2 where
import Data.List.Split
--Написать функцию parts, которая для данного списка проверяет, можно ли его разбить
--на несколько строго возрастающих кусков одинаковой длины.
--
--Длина кусков должна быть не меньше 2. Кусок может быть и только один.
@0rca
0rca / cli.hs
Created January 6, 2017 11:16
cli tool in Haskell
#!/usr/bin/env stack --silent runhaskell
{-# LANGUAGE OverloadedStrings #-}
import Console.Options
import Turtle
import Data.Text hiding (empty)
main = defaultMain $ do
programName "cli"
programDescription "personal CLI utilities"
// Place your settings in this file to overwrite the default settings
{
// "elm-format.formatOnSave": true,
"extensions.autoUpdate": true,
"files.trimTrailingWhitespace": true,
"files.insertFinalNewline": true,
"[elixir]": {
@0rca
0rca / keybase.md
Created January 24, 2018 09:17
keybase.md

Keybase proof

I hereby claim:

  • I am 0rca on github.
  • I am 0rca (https://keybase.io/0rca) on keybase.
  • I have a public key ASCwtu6-85S-997AZug0oK5Ms1OI6-ASPPixi7nRXbGH5wo

To claim this, I am signing this object: