Skip to content

Instantly share code, notes, and snippets.

View kika's full-sized avatar

Kirill Pertsev kika

View GitHub Profile
@kika
kika / userdata.sh
Created December 19, 2017 19:23 — forked from brantburnett/userdata.sh
Couchbase EC2 NVMe Userdata Script
#!/bin/bash
# Include as user data during instance startup, or run as root using sudo
# Assumes that you are using an i3 instance type with NVMe instance storage attached
# Set swappiness to zero
sysctl vm.swappiness=0
echo "vm.swappiness = 0" >> /etc/sysctl.conf
# Disable transparent huge pages
cat > /etc/init.d/disable-thp <<- 'EOM'
@kika
kika / keybase.md
Last active October 16, 2017 17:52

Keybase proof

I hereby claim:

  • I am kika on github.
  • I am kika (https://keybase.io/kika) on keybase.
  • I have a public key ASCjlH4m62ubWjf68rIp4m0vLJxP5eOP-aAqdik4q_fxKgo

To claim this, I am signing this object:

@kika
kika / backup_brew.sh
Last active November 22, 2016 03:25 — forked from donkaban/backup_brew.sh
#!/bin/bash
echo '#!/bin/bash'
echo ''
echo 'failed_items=""'
echo 'function install_package() {'
echo 'echo EXECUTING: brew install $1 $2'
echo 'brew install $1 $2'
echo '[ $? -ne 0 ] && $failed_items="$failed_items $1" # package failed to install.'
echo '}'
module TCO where
import Prelude
import Data.Either
import Control.Monad.Rec.Class
isEven::Int -> Boolean
isEven = tailRec (either isEven' isOdd') <<< Left
@kika
kika / combinators.md
Created August 27, 2016 00:48
How haskellers talk IRL
!    - No  
!!&! - No, No and NO!!  
.    - Period  
!&.  - No, period  
=    - Equal  
*    - All  
~*   - Not all/everything  
*=   - All the same/I don't care  
~*=? - Isn't everything the same? 
module DBResponse where
import Prelude
import Data.Foreign
import Data.Foreign.Class
data Doc a = Doc { doc :: a }
data CustomerResp = CustomerResp { rows :: Array (Doc Customer) }
data Customer = Customer {
@kika
kika / .vimrc
Created July 29, 2016 20:52
vimrc
colorscheme torte
if $SHELL =~ 'bin/fish'
set shell=/bin/sh
endif
"set lines=55
"set columns=83
set ruler
set dir=~/.vimswap//,/var/tmp//,/tmp//,.
set ts=4
set sw=4
module Main where
import Prelude
import Control.Monad.Eff
import Control.Monad.Eff.Console
type Config = {
debug::Boolean
}
@kika
kika / printf.purs
Last active June 20, 2017 13:11
Purescript variadic function - function with variable number of arguments of variable type
module Main where
import Prelude (class Show, Unit, ($), show, (++), (<<<))
import Control.Monad.Eff (Eff)
import Control.Monad.Eff.Console (CONSOLE, log)
import Data.String (joinWith)
import Data.ExistsR
class PrintF t where
printf' :: Array String -> t
@kika
kika / gist:e7d927ad8780fc485e2d
Created August 14, 2015 03:46
OS/X: Get the durations of the list of audio files and output CSV
mdls -name "kMDItemDisplayName" -name "kMDItemDurationSeconds" -raw *.wav | xargs -0 -L 2 echo | awk '{print $1 "," $2}'