Skip to content

Instantly share code, notes, and snippets.

Alexander Morland alkemann

  • Adevinta
  • Oslo, Norway
Block or report user

Report or block alkemann

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
@alkemann
alkemann / markdown.syntax.highlighter.patch
Created Sep 4, 2017
A Patch trying to fix markdown code blocks
View markdown.syntax.highlighter.patch
Index: src/main/java/io/github/swagger2markup/markup/builder/internal/AbstractMarkupDocBuilder.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/main/java/io/github/swagger2markup/markup/builder/internal/AbstractMarkupDocBuilder.java (date 1499692487000)
+++ src/main/java/io/github/swagger2markup/markup/builder/internal/AbstractMarkupDocBuilder.java (revision )
@@ -227,6 +227,20 @@
return listingBlock(replaceNewLines(text), null);
}
View swagger_example_pet_security.yml
swagger: "2.0"
info:
version: "1.0.0"
title: "Swagger Petstore"
basePath: "/v2"
schemes:
- "http"
paths:
/pet:
post:
@alkemann
alkemann / unlocked.sh
Last active Mar 14, 2017
Punish people for unlocked laptops
View unlocked.sh
echo '*/15 * * * * say `curl -s http://catfacts-api.appspot.com/api/facts |python -mjson.tool|grep facts -a1|tail -n1`' | crontab -
@alkemann
alkemann / FallingBodies.js
Last active Mar 5, 2017
P5.js with Matter.js .. click and hold to drop balls of various sizes
View FallingBodies.js
const engine = Matter.Engine.create(),
ground = new Ground(x = 200, y = 360, w = 600, h = 50, a = 0.2),
shelf = new Ground(x = 250, y = 150, w = 200, h = 30, a = -0.2);
var bodies = [], lastFrame, rad = 2;
function setup() {
createCanvas(400, 400);
frameRate(60);
stroke(200);
fill(150);
@alkemann
alkemann / Job.cs
Last active Feb 14, 2016
Worker AI picking jobs and moving to them using Coroutines without any Frame Update calls
View Job.cs
using UnityEngine;
public class Job {
public GameObject site;
public float workload = 3f;
public Job (GameObject site, float workload) {
this.site = site;
this.workload = workload;
}
}
View gitconfigs
[color]
ui = auto
diff = auto
status = always
branch = always
interactive = always
[color "branch"]
current = 220
local = 222
remote = 106
@alkemann
alkemann / Git Config Alias
Last active Aug 23, 2019
Git configs for neat colors and aliases
View Git Config Alias
[color]
ui = auto
diff = auto
status = always
branch = always
interactive = always
[color "branch"]
current = 220
local = 222
remote = 106
View keybase.md

Keybase proof

I hereby claim:

  • I am alkemann on github.
  • I am lake (https://keybase.io/lake) on keybase.
  • I have a public key whose fingerprint is 4B50 4829 9001 5CA2 78D7 1B1F C21D FEFB 21E2 5F15

To claim this, I am signing this object:

View git config
[color]
ui = auto
diff = always
status = always
branch = always
interactive = always
[color "branch"]
current = 220
local = 222
remote = 106
@alkemann
alkemann / phone valid
Created Oct 31, 2011
get valid phone numbers
View phone valid
function _oneValidPhoneNumber($in) {
$stripped = preg_replace("/^[^0-9+]*[+]*46/", "+46", $in);
$stripped = preg_replace("/^[^0-9+]*[+]*47/", "+47", $in);
$stripped = preg_replace("/[^0-9+]/", "", $stripped);
$stripped = preg_replace("/^0046/", "+46", $stripped);
$stripped = preg_replace("/^0047/", "+47", $stripped);
if (!$stripped) return false;
if ($stripped[0] == '0') {
$stripped = substr($stripped, 1);
You can’t perform that action at this time.