Skip to content

Instantly share code, notes, and snippets.

arbelt /
Created Jun 27, 2020 — forked from bbqtd/
Installing tmux-256color for macOS

Installing tmux-256color for macOS

macOS has ncurses version 5.7 which doesn't ship the terminfo description for tmux. There're two ways that can help you to solve this problem.

The Fast Blazing Solution

Instead of tmux-256color you can use screen-256color, place this command into your ~/.tmux.conf.

set-option -g default-terminal "screen-256color"
arbelt / textreg_example.R
Created May 15, 2020
Example with textreg
View textreg_example.R
library(wrapr) # for dot-pipe
df_mi <- df0 %.>%
filter(., !
corp_mi <- df_mi %.>%
pull(., mostimportant) %.>%
arbelt /
Created Oct 8, 2019 — forked from jamesrampton/
Clean up Mac OS X Open With menu
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user
killall Finder
arbelt / optimus.R
Created Aug 21, 2019
simple R implementation of "optimus" algorithm for obfuscating numeric IDs. Original PHP implementation at
View optimus.R
## Super simple implementation of "optimus" algorithm. Easy and fast way to
## encrypt/decrypt numbers. To make it more user-friendly, the `.settings`
## function generates a prime number and mask from a supplied key string. This
## depends on a stable hash of the string, so it's probably a good idea to jot
## down the underlying numbers (prime and mask) in case something changes with
## the hash internals. You'll always be able to decrypt if you know the prime
## and mask.
arbelt / drill-1.16-addDefaultRowPrefetch.patch
Last active Jul 25, 2019
Add connection parameters to JDBC connections for Drill 1.16
View drill-1.16-addDefaultRowPrefetch.patch
diff --git a/contrib/storage-jdbc/src/main/java/org/apache/drill/exec/store/jdbc/ b/contrib/storage-jdbc/src/main/java/org/apache/drill/exec/store/jdbc/
index ebff37173..16dc163c9 100755
--- a/contrib/storage-jdbc/src/main/java/org/apache/drill/exec/store/jdbc/
+++ b/contrib/storage-jdbc/src/main/java/org/apache/drill/exec/store/jdbc/
@@ -90,6 +90,8 @@ public class JdbcStoragePlugin extends AbstractStoragePlugin {
+ source.addConnectionProperty("defaultRowPrefetch", "200");
View blah.R
df <- tibble::tribble(
~id, ~response,
1, "Paris to Berlin blah blah blah",
2, "Hello there stuff berlin London to Madrid berlini-Stuff Dover",
3, "Białystok to Port-au-Prince",
4, "I went to Saudi",

Keybase proof

I hereby claim:

  • I am arbelt on github.
  • I am albertw ( on keybase.
  • I have a public key ASCBWZ3D7wuyMMGlT-Lz1hDrQ5BcRsuyy9kluIJ3Wiw-4wo

To claim this, I am signing this object:

arbelt /
Last active Oct 20, 2017
Simple script to fetch SSH keys from Github
#!/usr/bin/env perl
use v5.20;
use autodie;
#use HTTP::Tiny;
#my $agent = HTTP::Tiny->new(
#default_headers => { 'Accept' => 'application/json' }
arbelt / -
Last active Sep 14, 2017
fish abbreviations
View -
abbr R 'R --no-save'
abbr gst 'git status'
abbr gd 'git diff'
abbr ga 'git add'
abbr gc 'git commit'
abbr gdc 'git diff --cached'
abbr gcm 'git commit -m'
abbr gdt 'git difftool --extcmd icdiff'
abbr gl 'git pull'
abbr gco 'git checkout'
View Merging duplicate records with different fields filled in.R
library(tidyverse, purrr)
df <- tribble(~a, ~b, ~c, ~d,
1, 2, NA, 1,
1, 2, 3, NA,
2, 2, 1, 1,
2, 2, 1, 2)
keys_to_merge <- df %>% group_by(a,b) %>%
summarise_each(funs(sum(unique(.) %>% %>% `!`))) %>%