Skip to content

Instantly share code, notes, and snippets.

View jorabra's full-sized avatar

Jørgen Abrahamsen jorabra

View GitHub Profile
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
@jorabra
jorabra / init.coffee
Last active February 19, 2017 21:22
Atom sync settings
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
@jorabra
jorabra / BrregController.cs
Last active February 8, 2016 09:15
Combined search for main and under organization in the Brønnøysundregister.
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
using System.Web.Http;
using Newtonsoft.Json.Linq;
namespace Controllers
{

Keybase proof

I hereby claim:

  • I am jorabra on github.
  • I am jorabra (https://keybase.io/jorabra) on keybase.
  • I have a public key whose fingerprint is DDFE 6FB2 BADD 14AA 771A 6320 8A72 0346 E94C 9248

To claim this, I am signing this object:

@jorabra
jorabra / vim-margins
Last active December 20, 2015 20:49
Vim colored margins
highlight ColorColumn ctermbg=235 guibg=#2c2d27
" In Vim >= 7.3, also highlight columns 100+
if exists('+colorcolumn')
" (I picked 120-320 because you have to provide an upper bound and 320 just
" covers a 1080p GVim window in Ubuntu Mono 11 font.)
let &colorcolumn="80,".join(range(100,320),",")
else
" fallback for Vim < v7.3
autocmd BufWinEnter * let w:m2=matchadd('ErrorMsg', '\%>80v.\+', -1)

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2:

@jorabra
jorabra / gist:1327731
Created October 31, 2011 15:19
Play movies compressed using RAR with MPlayer
# http://dingleberry.me/2008/10/play-rar-files-with-vlc-mplayer/
unrar p -inul $1 | mplayer -cache 64000 -cache-min 50 -
@jorabra
jorabra / gist:1327378
Created October 31, 2011 12:23
TextBox KeyPress decimal number input validation.
private void ValidateKeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
{
if (!char.IsControl(e.KeyChar) && !char.IsDigit(e.KeyChar) && e.KeyChar != '.')
{
e.Handled = true;
}
// Only allow one decimal point
if (e.KeyChar == '.' && (sender as StxTextBox).Text.IndexOf('.') > -1)
{