Skip to content

Instantly share code, notes, and snippets.

View tregusti's full-sized avatar

Glenn Jorde tregusti

View GitHub Profile

Såpbubblor

När Miliam fyllde ett år, så lektes det med stora såpbubblor, och det var många som ville veta hur man gjorde en riktig såpbubblemix. Så här kommer receptet.

Ingredienser

  • ½ tsk guarkärnmjöl
  • 2 tsk glycerin
  • 1 liter vatten
  • 2½ msk handdiskmedel
(function() {
// Run this script in the console to add the foo cae event to the calendar.
'use strict';
let url = document.location.href;
let title = document.querySelector('h1').textContent;
let timestamp = document.querySelector('.eventtime p').textContent.trim();
let datematch = timestamp.match(/, (\w+) (\d+)/);
let from = new Date();
from.setMonth('January Februari March April May June July August September October November December'.split(' ').indexOf(datematch[1]));
@tregusti
tregusti / currentElement.js
Last active December 21, 2015 08:22
Output currently selected element in the browser console
(function() {
var a
setInterval(function() {
var a1 = document.activeElement
if (a !== a1) {
a = a1
var s = a.nodeName.toLowerCase()
if (a.id) s += '#' + a.id
if (a.className.trim()) s += '.' + a.className.trim().split(/\s/g).join('.')
console.log('focused: %s %o', s, a)
function NotImplementedError(message) {
this.message = message || "";
}
NotImplementedError.prototype = Object.create(Error.prototype, {
constructor: { value: NotImplementedError },
name: { value: 'NotImplementedError' },
stack: { get: function() {
return new Error().stack;
}},
});
@tregusti
tregusti / jira.css
Last active October 26, 2015 10:56
User styling for JIRA Agile boards
#ghx-work {
display: flex;
}
#ghx-work #ghx-pool-column {
display: block;
flex: 1;
}
#ghx-work #ghx-detail-view {
display: block;
}
@tregusti
tregusti / pr.md
Created July 2, 2015 09:00 — forked from piscisaureus/pr.md

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	url = git@github.com:joyent/node.git
	fetch = +refs/heads/*:refs/remotes/origin/*

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@tregusti
tregusti / polymer-polytechnics.md
Last active October 28, 2015 09:48
Malmö Polymer Polytechnics
@tregusti
tregusti / gyp-error
Created August 4, 2014 12:44
Install error for osx-tag module on node 0.11.13
> osx-tag@0.1.0 install /Users/glenn/code/abcdefgh/node_modules/osx-tag
> node-gyp rebuild
CXX(target) Release/obj.target/osx_tag/osx_tag.o
../osx_tag.mm:19:18: error: unknown type name 'uv_work_t'
void workGetTags(uv_work_t* req)
^
../osx_tag.mm:39:18: error: unknown type name 'uv_work_t'
void workSetTags(uv_work_t* req)
^
#!/usr/bin/env bash
# Removes ALL(!!!) tags on the remote origin. Run this when the tags are as they should locally.
# Then push all tags with `git push --tags`
git fetch --tags
git for-each-ref --shell --format="name=%(refname);" 'refs/tags' | \
while read entry
do
@tregusti
tregusti / pr.md
Created June 15, 2014 20:28 — forked from piscisaureus/pr.md

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this: