Skip to content

Instantly share code, notes, and snippets.

View Soft's full-sized avatar

Samuel Laurén Soft

View GitHub Profile
@Soft
Soft / keys
Created May 6, 2011 15:39
More vim like ncmpcpp keys config
key_move_song_up = 'K'
key_move_song_down = 'J'
key_next_found_position = 'n'
key_prev_found_position = 'N'
key_prev_column = 260 'h'
key_next_column = 261 'l'
key_lyrics = '.'
key_home = 262 'g'
key_end = 360 'G'
struct Z {};
template <typename N>
struct S {};
template <typename A, typename B>
struct Add {};
template <typename B>
struct Add<Z, B> {
@Soft
Soft / xmonad.hs
Created January 3, 2011 04:35
My Xmonad config
import XMonad
import XMonad.StackSet (sink)
import XMonad.Layout.Named (named)
import XMonad.Layout.NoBorders (smartBorders)
import XMonad.Layout.Reflect (reflectHoriz)
import XMonad.Layout.IM (withIM, Property(..))
import XMonad.Layout.ToggleLayouts (toggleLayouts, ToggleLayout(..))
import XMonad.Layout.ThreeColumns (ThreeCol(..))
import XMonad.Layout.Tabbed (tabbedBottom, defaultTheme, activeColor, inactiveColor,
urgentColor, activeTextColor, inactiveTextColor, urgentTextColor, activeBorderColor,
@Soft
Soft / tmux-swap-pane-with-largest.sh
Last active January 23, 2020 14:07
Swap active tmux pane with the largest pane
#!/usr/bin/env bash
tmux list-panes | awk '
BEGIN {
largest_area=0
largest_id=0
active_id=0
}
match($2, /\[([0-9]+)x([0-9]+)\]/, dim) {
area=dim[1]*dim[2]
@Soft
Soft / .vimrc
Created April 8, 2010 08:25
My .vimrc file
" Soft's .vimrc
" Useful plugins: indent-object, NERD_tree, NERD_commenter, delimitMate,
" snipMate, surround, Command-T, EasyMotion
" Nice colorschemes: Herald, Neverland, Mustang, Molokai
set nocompatible
if has("gui_win32")
source $VIMRUNTIME/mswin.vim
behave mswin
@Soft
Soft / feedbin-scrollbars.css
Created September 28, 2019 08:52
Firefox user style for Feedbin that makes scrollbars prettier
.entry-content,
.entries,
.feeds {
scrollbar-width: thin;
}
.theme-sunset .entry-content,
.theme-sunset .entries,
.theme-sunset .feeds {
scrollbar-color: #F2EEDB #F9F7EE;
@Soft
Soft / transducers.py
Last active May 10, 2019 20:38
Clojure style transducers
#!/usr/bin/env python3
from operator import add
def map_t(fn):
def trans(reducer):
def result(acc, input):
return reducer(acc, fn(input))
CC="clang"
CXX="clang++"
LD="clang"
LDFLAGS="-fsanitize=undefined,address"
CFLAGS="-march=native -O2 -pipe -fsanitize=undefined,address -ggdb"
CXXFLAGS="${CFLAGS}"
LDFLAGS="-fsanitize=undefined,address"
FEATURES="${FEATURES} splitdebug installsources"
USE="debug"
@Soft
Soft / context-menu.patch
Created August 22, 2018 13:08
Remove "Send as Email..." options from Firefox's context menus
diff --git a/browser/base/content/browser-context.inc b/browser/base/content/browser-context.inc
--- a/browser/base/content/browser-context.inc
+++ b/browser/base/content/browser-context.inc
@@ -210,14 +210,6 @@
label="&saveImageCmd.label;"
accesskey="&saveImageCmd.accesskey;"
oncommand="gContextMenu.saveMedia();"/>
- <menuitem id="context-sendimage"
- label="&emailImageCmd.label;"
- accesskey="&emailImageCmd.accesskey;"
/* XPM */
static char *test_big[] = {
/* columns rows colors chars-per-pixel */
"64 64 3 1 ",
" c col1",
". c col2",
"X c col3",
/* pixels */
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX....",