Skip to content

Instantly share code, notes, and snippets.

View stigok's full-sized avatar
🚢
ship it!

Stig Otnes Kolstad stigok

🚢
ship it!
View GitHub Profile
@stigok
stigok / reset.css
Created April 28, 2015 18:38
reset.css with Eric Meyer CSS Reset + Paul Irish border-box: none
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
@stigok
stigok / install_opensuse.sh
Last active August 15, 2018 03:28
PrivateInternetAccess.com OpenVPN installation script for OpenSUSE 13.2
#! /bin/sh -
#
# Install OpenVPN connections for all available
# regions to NetworkManager
#
# Important:
# This is a modified version of the official Ubuntu script PrivateInternetAccess.com
# released at https://www.privateinternetaccess.com/installer/install_ubuntu.sh
# Automatic installation of python and openvpn has been removed, and needs to be
# installed manually before installation.
@stigok
stigok / .eslintrc.js
Last active February 19, 2016 01:20 — forked from i-van/.eslintrc
ESLint rules my ego likes
module.exports = {
'rules': {
'indent': [
2,
2
],
'quotes': [
2,
'single'
],
@stigok
stigok / helpers.js
Last active March 10, 2016 20:38
Express web-server for Angular app with cached HTTP API backend
'use strict';
module.exports.jsonResponseObject = function jsonResponseObject(err, data) {
return {
meta: {
status: err ? (err.status || 500) : 200,
message: err ? (err.message || 'Error') : 'OK'
},
response: data || {}
};
@stigok
stigok / taskforce.js
Created March 10, 2016 21:12
Node.js Task & Worker
'use strict';
const _ = require('underscore');
function Task(fn) {
this.fn = fn;
}
function Worker(interval, tasks) {
this.interval = interval;
@stigok
stigok / hextime.sh
Last active March 23, 2017 14:00
Get current system time as hex string
#!/bin/bash
# Get zero-padded hex string from date format
# Usage: f <format>
function f {
printf %02X $(date +$1)
}
h=$(f %-H)
m=$(f %-M)
@stigok
stigok / atom-commands.md
Last active September 7, 2022 01:47
List of key bindable Atom commands

Atom Commands

Application

application:about
application:show-preferences
application:show-settings
application:quit
application:hide

application:hide-other-applications

@stigok
stigok / setbrightness.sh
Last active November 17, 2018 16:38
Set Intel backlight brightness level Linux bash (Samsung NP300V3A-SE07)
#!/bin/bash
#
# Set brightness of intel backlight
# Usage:
# setbrightness
# Print current brightness
# setbrightness <level>
# Set brightness to <level> 1-10
# setbrightness less
# Set brightness to current level - 1
@stigok
stigok / soundcloudplayer.js
Last active May 28, 2019 06:59
Angular.js SoundCloud player widget directive
angular.module('ngApp')
.directive('soundCloudPlayer', function () {
return {
restrict: 'E',
template: '<iframe width="100%" height="465" scrolling="no" frameborder="no"></iframe>',
link: function (scope, element, attrs) {
var iframe = element.find('iframe');
var settings = [
'buying=false',
'liking=false',
@stigok
stigok / materialize-base-colors.json
Created May 1, 2016 01:40
Materialize base colors JSON array
["red", "pink", "purple", "deep-purple", "indigo", "blue", "light-blue", "cyan", "teal", "green", "light-green", "lime", "yellow", "amber", "orange", "deep-orange", "brown", "grey", "blue-grey"]