Skip to content

Instantly share code, notes, and snippets.

View otijhuis's full-sized avatar

Okke Tijhuis otijhuis

  • Deventer, The Netherlands
View GitHub Profile

TMUX - Single window group, multiple session.

So I have been using tmux for a while and have grown to like it and have since added many many customizations to it. Now once you start getting the hang of it, you'll naturally want to do more with the tool.

Now tmux has a concept of window-group and session and if you are like me you'll want multiple session that connects to the same window group instead of a new window group every time. Basically I just need different views into the same set of windows that I have already created, I don't want to create a new set of windows every time I fire up my terminal.

This is the default case if you simply use the tmux command as your login shell, effectively creating a new group of windows every time you start tmux.

This is less than ideal because, if you are like me, you fire up one-off terminals all the time and you don't want all those one-off jobs to stay running in the background. Plus sometimes you need information fro

@otijhuis
otijhuis / _readme.md
Created January 17, 2019 21:25 — forked from hew/_readme.md
Operator Mono w/ Italics on OSX VIm

Operator Mono w/ Italics on OSX Vim

@otijhuis
otijhuis / Vue-cli-3-Phoenix-1.3-HOWTO.md
Created September 4, 2018 14:01 — forked from jpbecotte/Vue-cli-3-Phoenix-1.3-HOWTO.md
Vue-cli 3, Phoenix 1.3, a complete how-to

Introduction

I have been struggling to start a new project with Phoenix 1.3 and the new vue-cli 3 for Vue.js. There are tons of example already but none of them suited my needs, because:

  • I want to use the new Vue-cli to select the features that I want,
  • I do NOT want to setup Webpack (I know, what a shame!). The new Vue-cli includes the new vue-cli-service, which uses an instance of webpack-dev-server, so you don't have to import it manually in your project.
  • I do not want to use Brunch.

Create your Phoenix App

Assuming that you have Elixir and Phoenix 1.3 are both installed, let's build our new App.

@otijhuis
otijhuis / class_decorator.ts
Created August 16, 2017 21:42 — forked from remojansen/class_decorator.ts
TypeScript Decorators Examples
function logClass(target: any) {
// save a reference to the original constructor
var original = target;
// a utility function to generate instances of a class
function construct(constructor, args) {
var c : any = function () {
return constructor.apply(this, args);
}
@otijhuis
otijhuis / shift-parens.json
Created July 28, 2017 16:54
Karabiner Elements shift -> parens
{
"title": "Shift -> Parens",
"rules": [
{
"description": "map left shift to opening parenthesis",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "left_shift",
@otijhuis
otijhuis / Build.md
Created May 2, 2017 11:52 — forked from Eoksni/Build.md
Minimal Webpack DllPlugin example

Compile with:

webpack --config vendor.webpack.config.js
webpack --config app.webpack.config.js

Use with the following index.html

@otijhuis
otijhuis / init.lua
Created October 30, 2016 09:07
Hammerspoon - tapping ctrl sends escape
send_escape = false
last_mods = {}
control_key_handler = function()
send_escape = false
end
control_key_timer = hs.timer.delayed.new(0.15, control_key_handler)
control_handler = function(evt)
@otijhuis
otijhuis / osx-for-hackers.sh
Created December 24, 2015 11:56 — forked from matthewmueller/osx-for-hackers.sh
OSX for Hackers (Mavericks/Yosemite)
# OSX for Hackers (Mavericks/Yosemite)
#
# Source: https://gist.github.com/brandonb927/3195465
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Ask for the administrator password upfront
@otijhuis
otijhuis / learning-clojure
Created June 25, 2014 15:09
The things I remember most when learning Clojure
For me the toughest part of learning Clojure for me has been the switch to functional style thinking. Probably took me 6 months of doing Clojure in my spare time. I’ve used quite a few languages but all of them were mostly object oriented. You basically have to throw a lot of stuff you know out of the window and start from scratch. Clojure is probably far easier to learn for someone who doesn’t have an object oriented background.
The things I remember most when learning Clojure:
- forcing myself to use higher order functions instead of using a loop whenever possible. Coming from an imperative style you have to force yourself to think differently about problems
- brushing up on recursion. You use it all the time in functional programming
- being amazed at how little mutable state you actually need. We have a piece of Clojure software in production that contains no mutable state at all
- how handy lazy evaluation is. Creating infinite sequences is so much easier to reason about. No need to worry about how man
@otijhuis
otijhuis / gist:b411c57b2a99e7a47168
Created May 10, 2014 03:43
Stackoverflow Clojure performance solution
(ns calc.core)
(def start (biginteger 1))
(def b (.pow (biginteger 2) 20))
(def g (biginteger 11717829880366207009516117596335367088558084999998952205599979459063929499736583746670572176471460312928594829675428279466566527115212748467589894601965568))
(def p (biginteger 13407807929942597099574024998205846127479365820592393377723561443721764030073546976801874298166903427690031858186486050853753882811946569946433649006084171))
(def h (biginteger 3239475104050450443565264378728065788649097520952449527834792452971981976143292558073856937958553180532878928001494706097394108577585732452307673444020333))
(defn build-left-table [start end p h g]
(into {}