Skip to content

Instantly share code, notes, and snippets.

Elixir, React, Phoenix, Rust.

Anders Ytterström madr

Elixir, React, Phoenix, Rust.
View GitHub Profile
madr / rutnät.scss
Created Nov 3, 2015
simple bootstrap for your own grid system
View rutnät.scss
@charset "utf-8";
// Grids, loosely based on Flexbox grid:
// extend to use flexbox
%row {
box-sizing: border-box;
display: -webkit-box;
display: -webkit-flex;
madr /
Created Sep 2, 2015
Download whole site recursively over FTP using wget
# set --cut-dir to the no parents that should be omitted (in this case 2: a and b)
wget -nv -r -nH --cut-dirs=2 ftp://<username>:<passwd>@<server>/a/b/
madr / original-simplified.css
Last active Aug 29, 2015
OOCSS grids, flexbox edition
View original-simplified.css
.line {
overflow: hidden;
.unit {
float: left;
box-sizing: border-box;
.size1of1 { float: none; }
View gist:4a99074b8855236aa8f9
for (var i = 0, max = json.length; i < max; i++) {
selectElm.innerHTML += "<option value='" +json["id"] + "'>" + json["foretag"] + "</option>";
madr /
Last active Aug 29, 2015
Contrast check: determine foreground color
based on:
accepts hex colors with 3 or 6 chars. hash-char is optional.
def get_contrast_yiq(hex_color):
hex_color = hex_color.replace("#", "")
if len(hex_color) == 3:
hex_color = "".join([c + c for c in hex_color])
View view.php
* view.php
* simple view class, template-based.
* @todo indent markup using tidy?
* $Rev$
* $Author$
* $Date$
madr /
Created Apr 19, 2015
Heroes of the Storm on Elementary Freya

So you want to run Diablo III on Linux? Hopefully this general installation guide helps some of you into doing that.

Why write this up?

Well, in the past there have been several threads that popped up about running the game on linux. Some of them were just that they couldn't get the program to run and others were heavily distorted graphics, like in the launcher, which made things unplayable. Since Blizzard doesn't support linux then it is left up to the users to find help for their problems. While linux use is at all new highs in the consumer market making it on par with MacOS in terms of numbers the lack of a centralized forum for linux or any official support makes finding help hit or miss usually.

Hopefully this installation guide will help some of the people who want to play the game on linux but are having issues.

Lets get started!

View gist:fb56c0091759a7c2003f


Härmed deklarerar jag (Förnamn Efternamn, personnummer) att jag med beklagande härmed säger upp min anställning som X på företaget Y.

Jag har uppskattat min tid på företaget och hoppas att även ni har uppskattat mitt hårda arbete, men nu söker jag mig mot nya äventyr och utmaningar.

Jag säger upp mig med enlighet av min uppsägningstid på Z, bla bla bla.

Tack for gott samarbete.

View feedly.js
var titles = [], urls = [], rows = document.querySelectorAll("#section0_column0 > div"), i = rows.length, lastI = i; while (i--) { titles.push(rows[i].getAttribute("data-title")); urls.push(rows[i].getAttribute("data-alternate-link")); } titles = (t, i) { return "[" + t + "][" + (i + 1) + "] \nskriv nåt bra här\n"; } ); console.log(titles.join("\n")); urls = (u, i) { return "[" + (i + 1) + "]: " + u; }); console.log(urls.join("\n"));
madr / random.js
Last active Aug 29, 2015
Comparison of getting random values in different languages
View random.js
(function () {
"use strict";
var v, bandMembers = ["Hansi", "Andre", "Marcus", "Thomen"];
// 1. one random number between 1 and 10
v = Math.ceil(Math.random() * 10);
// 2: one random member of Blind Guardian
v = bandMembers[Math.ceil(Math.random() * (bandMembers.length - 1))];
You can’t perform that action at this time.