Skip to content

Instantly share code, notes, and snippets.

View fikovnik's full-sized avatar

Filip Krikava fikovnik

View GitHub Profile
---
title: "R Notebook"
output: html_notebook
---
```{r}
library(readr)
library(devtools)
library(dplyr)
library(stringr)
@fikovnik
fikovnik / install-parallel.sh
Last active May 31, 2018 10:46
Install latest GNU parallel
#!/bin/sh
wget http://ftp.gnu.org/gnu/parallel/parallel-latest.tar.bz2 && \
mkdir parallel && \
tar xfvj parallel-latest.tar.bz2 -C parallel --strip 1 && \
cd parallel && \
./configure --prefix=/usr/local && \
sudo make install && \
cd .. && \
rm -fr parallel && \
@fikovnik
fikovnik / base16-oceanicnext-colors.txt
Last active April 26, 2018 06:23
base16-oceanicnext theme colors specification
Index Color Name Term Name Hex Description
---------------------------------------------------------------------------------------------------------
0 black base00 1B2B34 Default Background
10 brightgreen base01 343D46 Lighter Background (Used for status bars)
11 brightyellow base02 4F5B66 Selection Background
8 brightblack base03 65737E Comments, Invisibles, Line Highlighting
12 brightblue base04 A7ADBA Dark Foreground (Used for status bars)
7 white base05 C0C5CE Default Foreground, Caret, Delimiters, Operators
13 brightmagenta base06 CDD3DE Light Foreground (Not often used)
15 brightwhite base07 D8DEE9 Light Background (Not often used)
@fikovnik
fikovnik / Matcher.scala
Created March 2, 2018 13:32
Simple matcher for Scala
object MatchExample extends App {
trait Matcher[-T] extends (T => Boolean)
def matches[A](x: A, m: Matcher[A]) = m(x)
trait F[-C[_]] {
def contains[A >: B, B](c: C[A], x: B): Boolean
}
@fikovnik
fikovnik / getxkblayout.c
Created February 7, 2018 09:43
Get keyboard layout using X11
// compile with `gcc -I/usr/include getxkblayout.c -lX11 -lxkbfile`
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <X11/XKBlib.h>
#include <X11/extensions/XKBrules.h>
int main(int argc, char **argv) {
Display *dpy = XOpenDisplay(NULL);
@fikovnik
fikovnik / configuration.nix
Last active July 12, 2022 06:29
NixOS on DELL XPS 13 9360
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).
{ config, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
#!/bin/bash -x
set -e
# scp-speed-test.sh
# Author: Alec Jacobson
# Modified: Filip Krikava
#
# Test ssh connection speed by uploading and then downloading a 10000kB test
# file (optionally user-specified size)
#
# Usage:
@fikovnik
fikovnik / tmux_build_from_source_CentOS.sh
Created July 27, 2017 15:06 — forked from P7h/tmux__CentOS__build_from_source.sh
tmux 2.0 and tmux 2.3 installation steps for Ubuntu. Or build from source.
# Steps to build and install tmux from source.
# Takes < 25 seconds on EC2 env [even on a low-end config instance].
VERSION=2.5
sudo yum -y remove tmux
sudo yum -y install wget tar libevent-devel ncurses-devel
wget https://github.com/tmux/tmux/releases/download/${VERSION}/tmux-${VERSION}.tar.gz
tar xzf tmux-${VERSION}.tar.gz
rm -f tmux-${VERSION}.tar.gz
cd tmux-${VERSION}
@fikovnik
fikovnik / install.sh
Last active June 7, 2023 09:01
Install dotfiles
#!/bin/bash -x
BACKUP_DIR="$HOME/.dotfiles-backup"
[ -d $HOME/.dotfiles ] || git clone --bare https://github.com/fikovnik/dot-files.git $HOME/.dotfiles
function config {
git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME $@
}
Apache Maven 3.5.0 (ff8f5e7444045639af65f6095c62210b5713f426; 2017-04-03T21:39:06+02:00)
Maven home: /usr/local/Cellar/maven/3.5.0/libexec
Java version: 1.8.0_102, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_102.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.12.4", arch: "x86_64", family: "mac"
[DEBUG] Created new class realm maven.api
[DEBUG] Importing foreign packages into class realm maven.api
[DEBUG] Imported: javax.enterprise.inject.* < plexus.core
[DEBUG] Imported: javax.enterprise.util.* < plexus.core