Skip to content

Instantly share code, notes, and snippets.

View spikensbror's full-sized avatar

Kimmy Andersson spikensbror

  • Monitor ERP System AB
  • Sweden
View GitHub Profile
@spikensbror
spikensbror / wix.ca.targets
Created April 14, 2019 13:40
Hack to get MakeSfxCA.exe packaging of WiX custom actions to work for long paths.
<!-- Run the MakeSfxCA.exe CA packaging tool. -->
<!--<Exec Command='"$(MakeSfxCA)" "@(IntermediateCAPackage)" "$(SfxCADll)" "@(IntermediateCAAssembly)" "$(CustomActionContents)"' WorkingDirectory="$(ProjectDir)" />-->
<PropertyGroup>
<PowerShellTempFileName>$([System.IO.Path]::GetTempPath())$([System.Guid]::NewGuid()).ps1</PowerShellTempFileName>
<PowerShellContent>&amp; "$(MakeSfxCA)" "@(IntermediateCAPackage)" "$(SfxCADll)" "@(IntermediateCAAssembly)" "$([System.String]::Join(";", $(CustomActionContents)))"</PowerShellContent>
</PropertyGroup>
<WriteLinesToFile File="$(PowerShellTempFileName)" Lines="$(PowerShellContent)" Overwrite="true" Encoding="Unicode" />
@spikensbror
spikensbror / Railway.fs
Created March 6, 2019 20:40
Railway-oriented-programming helpers based on Scott Wlaschin's concept at https://fsharpforfunandprofit.com/posts/recipe-part2/
namespace <namespace>
module Railway =
// convert a single value into a two-track result
let succeed x =
Ok x
// convert a single value into a two-track result
let fail x =
Error x
@spikensbror
spikensbror / init.vim
Last active December 29, 2018 01:14
Neovim configuration file
" About
" The movement keys have been remapped so that they respond to JKLÖ instead of HJKL, this
" goes for window navigation as well (ctrl+w).
" :call SetupWorkspace() can be invoked to setup a terminal on the bottom as well as two
" vertical splits on top.
" ctrl+r can be used instead of F5 in ctrlp.
@spikensbror
spikensbror / .vsvimrc
Created December 19, 2017 13:45
My VsVim configuration file.
noremap h <NOP>
noremap j <Left>
noremap k <Down>
noremap l <Up>
noremap ö <Right>
@spikensbror
spikensbror / iis-appcmd-link.txt
Last active August 29, 2015 14:26
Start or Stop an Application Pool (IIS 7)
@spikensbror
spikensbror / pagination.php
Last active March 27, 2016 13:17
Pagination collapse algorithm.
<?php
$pages = 20;
$padding = 3;
$dedicated = 4;
function paginate($page)
{
global $pages;
global $padding;
@spikensbror
spikensbror / .bashrc
Created February 17, 2015 15:30
My bash configuration.
# GruvBox 256 palette fix for the terminal.
source ~/.vim/bundle/gruvbox/gruvbox_256palette.sh
# Git indicator in PS1.
source ~/.git-prompt.sh
export GIT_PS1_SHOWDIRTYSTATE=1
export GIT_PS1_SHOWSTASHSTATE=1
export GIT_PS1_SHOWUNTRACKEDFILES=1
export GIT_PS1_SHOWUPSTREAM='auto'
export PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h$(__git_ps1 " (%s)")\[\033[01;34m\] \w\[\033[00m\]\n\$ '
@spikensbror
spikensbror / .vimrc
Last active August 29, 2015 14:12
My current vim configuration.
"===== Using this configuration. ====="
" This configuration expects Vim to be ran through gVim and requires pathogen to
" be installed as well.
" It also requires the following plugins in order to function as expected:
" * ctrlp.vim - https://github.com/kien/ctrlp.vim
" * vim-colorschemes - https://github.com/flazz/vim-colorschemes
" * vim-bbye - https://github.com/moll/vim-bbye
@spikensbror
spikensbror / debian-to-testing.sh
Created June 15, 2014 15:30
Upgrades a debian install's repositories to testing.
#!/bin/bash
cp /etc/apt/sources.list{,.bak}
sed -i -e 's/ \(stable\|wheezy\)/ testing/ig' /etc/apt/sources.list
apt-get update
apt-get --download-only dist-upgrade
apt-get dist-upgrade
@spikensbror
spikensbror / .vimperatorrc
Created June 9, 2014 02:29
~/.vimperatorrc - Firefox Vimperator configuration.
" Remap keys to fit swedish touch-typing.
nmap j <Left>
nmap k <Down>
nmap l <Up>
nmap ö <Right>
nmap J :back <C-m>
nmap Ö :forward <C-m>
" Remap Ctrl-a in insert mode to select all.
:inoremap <C-a> <Ins><C-a><Ins>