Skip to content

Instantly share code, notes, and snippets.

View madr's full-sized avatar
🤘
Elixir, React, Phoenix Liveview, Rust.

Anders Englöf Ytterström madr

🤘
Elixir, React, Phoenix Liveview, Rust.
View GitHub Profile
@madr
madr / bookmarket.js
Last active August 29, 2015 14:00
Dota stats
/*jslint indent: 2, devel: true, browser: true */
(function () {
"use strict";
function scrape(stopAt, startAt) {
var iframe = document.createElement("iframe"),
games = [],
heroes = {},
wins = 0,
page = 1,
heroesPlayed,
@madr
madr / gist:aab7ef174eec894d5c34
Created May 7, 2014 11:17
example github webhook post
{
"ref": "refs/heads/master",
"after": "7d97f223924e0c7440680892cefdb2d97ff662a3",
"before": "ae249ec5c919d54f76c700178061652ed65286de",
"created": false,
"deleted": false,
"forced": false,
"compare": "https://github.com/madr/bearded-sansa/compare/ae249ec5c919...7d97f223924e",
"commits": [
{
<!DOCTYPE html>
<meta charset="utf-8">
<style>
body { margin: 0; }
div { position: absolute; width: 20px; height: 20px; border-radius: 50%; background: red; }
</style>
<img src="mupp2.png" alt="" width="2500" height="2500">
<div hidden></div>
<script>
/*jslint browser: true */
@madr
madr / Makefile
Created September 1, 2014 14:42
Automated Wordpress FTP deployment using composer
install:
composer install
composer update
deploy:
php vendor/bin/deployment deployment.ini
test-deploy:
php vendor/bin/deployment deployment.ini --test
@mixin gradient-stopped ($fromcolor, $tocolor, $stop) {
background-color: $tocolor;
background-image: -moz-linear-gradient(180deg, $fromcolor, $tocolor $stop, $tocolor);
background-image: -ms-linear-gradient(top, bottom, $fromcolor, $tocolor $stop, $tocolor);
background-image: -webkit-linear-gradient(top, bottom, $fromcolor, $tocolor $stop, $tocolor);
background-image: linear-gradient(180deg, $fromcolor, $tocolor $stop, $tocolor);
}
@madr
madr / random.js
Last active August 29, 2015 14:07
Comparison of getting random values in different languages
(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))];
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 = titles.map(function (t, i) { return "[" + t + "][" + (i + 1) + "] \nskriv nåt bra här\n"; } ); console.log(titles.join("\n")); urls = urls.map(function (u, i) { return "[" + (i + 1) + "]: " + u; }); console.log(urls.join("\n"));

Hej,

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.

@madr
madr / howto.md
Created April 19, 2015 14:25
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!

@madr
madr / view.php
Created April 30, 2015 07:33
view.php
<?php
/**
* view.php
*
* simple view class, template-based.
* @todo indent markup using tidy?
*
* $Rev$
* $Author$
* $Date$