Skip to content

Instantly share code, notes, and snippets.

View barning's full-sized avatar

Niklas barning

View GitHub Profile
int level;
void restart () {
map = new Map( "karte"+level+".map");
}
void draw (){
restart();
}
@barning
barning / keybase.md
Last active August 29, 2015 13:57
keybase.md

Keybase proof

I hereby claim:

  • I am barning on github.
  • I am barning (https://keybase.io/barning) on keybase.
  • I have a public key whose fingerprint is F6ED 2862 7159 C8B2 CFAB 039C B952 759B 3B50 06A7

To claim this, I am signing this object:

@barning
barning / Robot
Created December 14, 2014 16:05
Unser Roboter
class MyRobot extends Robot {
private final float STANDING = 0.0005f;
private float mAngle;
private final Sensor mSensor_front;
private final Sensor mSensor_left;
private final Sensor mSensor_right;
private final Sensor mSensor_back;
var downloadAsSVG = function (fileName) {
if(!fileName) {
fileName = "dieflaeche"+second()+minute()+day()+year()+".svg"
}
var url = "data:image/svg+xml;charset=utf-8,"+encodeURIComponent(mySVG);
var link = document.getElementById("download");
link.download = fileName;
link.href = url;
link.click();
}
var ctx = new C2S(width,height);
ctx.translate(width/2,height/2);
var poly=[ v2.x, v2.y, v3.x, v3.y, v4.x, v4.y, v5.x, v5.y,v6.x, v6.y ];
ctx.beginPath();
ctx.moveTo(poly[0], poly[1]);
for( item=2 ; item < poly.length-1 ; item+=2 ){ctx.lineTo( poly[item] , poly[item+1] )}
ctx.closePath();
//ctx.fillStyle = "rgba(255,255,255,0)";
ctx.strokeStyle = 'rgb('+r+','+g+','+b+')';
ctx.lineWidth = 5;
@barning
barning / imagerotator.php
Created March 5, 2015 14:55
Random Background Image PHP
<?php
/*
AUTOMATIC IMAGE ROTATOR
Version 2.2 - December 4, 2003
Copyright (c) 2002-2003 Dan P. Benjamin, Automatic, Ltd.
All Rights Reserved.
http://www.hiveware.com/imagerotator.php
@barning
barning / variant-generation.scss
Created August 30, 2018 07:43
Generates a list of bem modifiers
$list: (
xsmall: 12px,
small: 16px,
medium: 24px,
large: 32px
);
@each $name, $size in $list {
.element--#{$name} {
width: $size;
@barning
barning / color-tiles.scss
Last active November 7, 2018 13:24
Color Tile Generator
$colors: (
primary: #de1c24,
secondary: #d3ffce,
):
// Generates Colors Tiles automatically. No need to write more SCSS
@each $name, $color in $colors {
&--#{$name} {
.color-tile__color {
background-color: $color;
@barning
barning / cssGridForIe.scss
Last active May 28, 2019 11:56
Generating css grid for IE and browsers we really love
@mixin cssGrid {
display: -ms-grid;
display: grid;
}
@mixin cssGridTemplateCol($input) {
-ms-grid-columns: #{$input};
grid-template-columns: #{$input};
}
@barning
barning / ffmpeg-background-video
Created July 15, 2020 12:00
Compress a video for web background
ffmpeg -y -i input.mov -c:v libx264 -crf 30 -profile:v high -pix_fmt yuv420p -color_primaries 1 -color_trc 1 -colorspace 1 -movflags +faststart -an output.mp4