Skip to content

Instantly share code, notes, and snippets.

Tomas Sandven Hubro

Block or report user

Report or block Hubro

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View config
# vim: ft=i3config
# DON'T EDIT THIS FILE MANUALLY - It has been automatically built by:
# /home/tomas/Dropbox/Personal/config_sync/i3/
# This file should contain general i3 settings as well as shared variables. If
# the variable list grows long it should get its own file.
set $mod Mod4
Hubro / i3-communication-layout.json
Created Mar 17, 2019
Example i3 layout that causes Slack to crash
View i3-communication-layout.json
// splitv split container with 2 children
"border": "normal",
"layout": "splitv",
"percent": 0.4,
"type": "con",
"nodes": [
"border": "pixel",
"current_border_width": 2,
Hubro / main.go
Created Feb 17, 2017
Line counter written in Go
View main.go
package main
import (
View freshontv-check.rb
#!/usr/bin/env ruby
require "yaml"
require "uri"
require "openssl"
require "net/http"
require "nokogiri"
Hubro / apline
Created Jan 23, 2015
Command for appending/prepending text to lines
View apline
# Append/prepend text to line
function usage
echo -e "Usage: $(basename "$0") [a|p] TEXT"
echo -n "apline reads from standard input and appends/prepends TEXT to "
echo "each line."
Hubro /
Created Jun 13, 2012
Python virtual environment selector
function pyenv() {
# Procure env name. If it was supplied in an argument, use that
if [[ "$1" != "" ]]
# Otherwise prompt the user for it
Hubro / report_to_json.php
Created Mar 27, 2012
Function for converting an xml report from Yahoo Web Analytics into a json format
View report_to_json.php
# Function for converting an xml report into a json format
function report_to_json($path)
# Check if the file exists
if(!file_exists($path)) return false;
# Set content type to json and charset to utf-8
# header('Content-type: application/json; charset=utf-8');
Hubro / gist:1876138
Created Feb 21, 2012
Shortcut function for top-down css gradients, written in stylus
View gist:1876138
// Shortcut for top-down gradient background color
td_gradient(color1, color2)
background-color (color1 + (color2 - color1) / 2)
background -webkit-gradient(linear, 0% 0%, 0% 100%, from(color1), to(color2))
background -webkit-linear-gradient(top, color1, color2)
background -moz-linear-gradient(top, color1, color2)
background -ms-linear-gradient(top, color1, color2)
background -o-linear-gradient(top, color1, color2)
You can’t perform that action at this time.