Skip to content

Instantly share code, notes, and snippets.

View Pitometsu's full-sized avatar
🐫
∀:camel:.P(:camel:) → ∅ ≡ (∃:camel:.P(:camel:)) → ∅

Yuriy Pitomets Pitometsu

🐫
∀:camel:.P(:camel:) → ∅ ≡ (∃:camel:.P(:camel:)) → ∅
View GitHub Profile
@snuggs
snuggs / .tmux.conf
Last active August 22, 2024 14:22
IDE & TMUX Configuration
############################################################################
# _
# | |_ _ __ ___ _ ___ __
# | __| '_ ` _ \| | | \ \/ /
# | |_| | | | | | |_| |> <
# \__|_| |_| |_|\__,_/_/\_\
#
# Cheatsheets:
# https://devhints.io/tmux
# `property not found` issue:
@master-q
master-q / xmonad.hs
Last active May 2, 2022 06:26
Xmonad setting
import XMonad
import XMonad.Actions.GridSelect
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Util.Run(spawnPipe)
import XMonad.Layout.Magnifier
import XMonad.Layout.NoBorders
import XMonad.Layout.Grid
import XMonad.Prompt
import XMonad.Prompt.Shell
@spicycode
spicycode / tmux.conf
Created September 20, 2011 16:43
The best and greatest tmux.conf ever
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000
@redinger
redinger / Emacs.md
Created November 26, 2011 03:22
Setting up Emacs daemon on OS X

Setting up Emacs daemon on OS X

Tired of waiting for emacs to start on OS X? This step by step guide will teach you how to install the latest version of emacs and configure it to start in the background (daemon mode) and use emacsclient as your main editor.

Install Cocoa Emacs

Download the latest pretest version of [Emacs for Mac OS X]: http://emacsformacosx.com/builds

@flashingpumpkin
flashingpumpkin / coroutine.py
Created March 1, 2012 16:55
Decorator for coroutine usage.
def coroutine(func):
"""
A decorator that turns a function with normal input into a coroutine.
This decorator takes care of priming the coroutine, doing the looping and
handling the closing.
The first argument of any decorated function is what was received when
data was sent to the coroutine via the ``.send`` method. All the other
``*args`` and ``**kwargs`` are what was passed to the decorated function
when instantiating the coroutine.
@mmagm
mmagm / heap-sort.hs
Last active February 2, 2018 07:21
haskell heap sort
import Data.List
swap :: Int -> Int -> [a] -> [a]
swap i j xs | i == j = xs
swap i j xs | otherwise = initial ++ (xs !! b) : middle ++ (xs !! a) : end
where [a,b] = sort [i,j]
initial = take a xs
middle = take (b-a-1) (drop (a+1) xs)
end = drop (b+1) xs
{-# LANGUAGE NoMonomorphismRestriction, ViewPatterns #-}
import XMonad
import System.Exit
import Control.Monad
import Control.Concurrent
import Control.Arrow (second)
@travitch
travitch / NotificationDaemon.hs
Created September 12, 2012 14:37
A freedesktop notification plugin for xmobar
{-# LANGUAGE OverloadedStrings, RankNTypes, KindSignatures, FlexibleContexts #-}
module Plugins.NotificationDaemon where
-- xmobar plugin API
import Plugins
import DBus.Bus
import DBus.Client
import DBus.Constants
@dacr
dacr / gist:4642782
Last active July 9, 2020 11:02
Custom scala collection examples
import scala.collection._
import scala.collection.mutable.{ArrayBuffer,ListBuffer, Builder}
import scala.collection.generic._
import scala.collection.immutable.VectorBuilder
// ================================ CustomTraversable ==================================
object CustomTraversable extends TraversableFactory[CustomTraversable] {
@pthariensflame
pthariensflame / IndexedState.md
Last active June 15, 2022 18:42
An introduction to the indexed state monad in Haskell, Scala, and C#.

The Indexed State Monad in Haskell, Scala, and C#

Have you ever had to write code that made a complex series of succesive modifications to a single piece of mutable state? (Almost certainly yes.)

Did you ever wish you could make the compiler tell you if a particular operation on the state was illegal at a given point in the modifications? (If you're a fan of static typing, probably yes.)

If that's the case, the indexed state monad can help!

Motivation