Skip to content

Instantly share code, notes, and snippets.

View nerdbeere's full-sized avatar
🤔
Building magical things

Julian Hollmann nerdbeere

🤔
Building magical things
View GitHub Profile
@nerdbeere
nerdbeere / main.rs
Created November 14, 2018 10:37
geldwechsel
fn main() {
let change_total = 333;
let mut remaining = change_total;
for unit in [200, 100, 50, 20, 10, 5, 2, 1].iter() {
let amount = remaining / unit;
println!("Unit: {0}, Amount: {1}", unit, amount);
remaining = remaining % unit;
}
}
#!/usr/bin/env node
const fs = require('fs');
const path = require('path');
const { createCanvas, loadImage } = require('canvas');
const tilePath = path.join(__dirname, '../tiles/black-white/11');
const tileSize = 256;
const path = require('path');
const fs = require('fs');
const mkdirp = require('mkdirp');
const fastXmlParser = require('fast-xml-parser');
const merge = require('deepmerge');
const Parser = fastXmlParser.j2xParser;
const traverse = require('traverse');
const pathToOsmFiles = path.join(__dirname, '../fortnite/');
const outPath = path.join(__dirname, '../generated/');
Recv: EPR:2 75 115200 Baudrate
Recv: EPR:3 129 111.226 Filament printed [m]
Recv: EPR:2 125 69434 Printer active [s]
Recv: EPR:2 79 0 Max. inactive time [ms,0=off]
Recv: EPR:2 83 360000 Stop stepper after inactivity [ms,0=off]
Recv: EPR:3 3 100.0000 X-axis steps per mm
Recv: EPR:3 7 100.0000 Y-axis steps per mm
Recv: EPR:3 11 400.0000 Z-axis steps per mm
Recv: EPR:3 15 400.000 X-axis max. feedrate [mm/s]
Recv: EPR:3 19 400.000 Y-axis max. feedrate [mm/s]
;FLAVOR:RepRap
;TIME:2521
;Filament used: 1.36604m
;Layer height: 0.1
;Generated with Cura_SteamEngine 2.5.0
M190 S60
M104 S205
M109 S205
G21 ;metric values
G90 ;absolute positioning
class UiAdapter {
constructor(coreApi, uiApi) {
coreApi.on('statechange', (state) => {
uiApi.setState(state);
});
uiApi.onAction('play', () => {
coreApi.transitionTo('play');
});
.iframe-container {
position: relative;
padding-bottom: 56.25%;
height: 0;
}
.iframe-container iframe {
position: absolute;
top: 0;
left: 0;
const test = require('ava');
const sinon = require('sinon');
const walk = require('../src/walk');
let result;
test.beforeEach(() => {
result = [[0, 0], [0, 1], [-1, 1], [-1, 0], [-1, -1], [0, -1], [1, -1], [1, 0], [1, 1], [1, 2]];
});
test('It walks in a spiral', t => {
// module tracker.js
function Tracker(foo, bar) {
this._foo = foo;
}
Tracker.prototype.echo = function(str) {
this._foo.echo(str);
}
module.exports = Tracker;
Ecig.faq = [
{
question: 'foo',
answer: 'bar',
image: 'schnitzel.jpg'
},
{
question: 'foo2',
answer: 'bar2',
image: 'schnitzel2.jpg'