Machine definition for custom Aluminium Extrusion Ultimaker 2 clone
(Ulti-Alu-Maker). Copy to ~/.local/share/cura/machines.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <time.h> | |
| #include <string.h> | |
| #include <stdio.h> | |
| #include <math.h> | |
| int iso8601_time(char* buf, size_t size) | |
| { | |
| struct timespec ts; | |
| struct tm tm_local; | |
| struct tm tm_gm; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| def lesseq(a, b, c, d) | |
| return a * d <= c * b | |
| end | |
| lower_numer = 2 | |
| lower_denom = 1 | |
| upper_numer = 3 | |
| upper_denom = 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // Rotary Encoder Driver | |
| // | |
| // Copyright (C) 2016 by Lars Christensen <larsch@belunktum.dk> | |
| // MIT License | |
| // | |
| #include "rotary.hpp" | |
| #include <avr/interrupt.h> | |
| #include <avr/io.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh -exu | |
| dev=$1 | |
| cd $(mktemp -d) | |
| function umountboot { | |
| umount boot || true | |
| umount root || true | |
| } | |
| # RPi1/Zero (armv6h): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <pcap.h> | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <pthread.h> | |
| #include <unistd.h> | |
| #include <signal.h> | |
| pcap_t* pcap; | |
| void* thread(void* arg) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Attach an event listener to an object. Invokes the handle() | |
| * callback on every event, and the apply() handler eventually, but | |
| * with at least 'delay' milliseconds between each invokation. | |
| */ | |
| function addThrottledEventHandler(elem, event, handle, apply, delay) { | |
| let nextApply = performance.now(); | |
| let timerId = null; | |
| function invokeApply() { apply(); timerId = null; } | |
| elem.addEventListener(event, (ev) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh -exu | |
| ip netns delete ns1 | |
| ip netns delete ns2 | |
| ip netns add ns1 | |
| ip netns add ns2 | |
| ip link add veth-ns1 type veth peer name veth-ns2 | |
| ip link set veth-ns1 netns ns1 | |
| ip link set veth-ns2 netns ns2 | |
| ip -n ns1 link set veth-ns1 up | |
| ip -n ns2 link set veth-ns2 up |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh -exu | |
| ip netns delete ns1 | |
| ip netns delete ns2 | |
| ip netns add ns1 | |
| ip link add veth-ns1 type veth peer name veth-ns2 | |
| ip link set veth-ns1 netns ns1 | |
| ip -n ns1 link set veth-ns1 up | |
| ip link set veth-ns2 up | |
| ip -n ns1 address add 10.0.0.1/30 dev veth-ns1 | |
| ip address add 10.0.0.2/30 dev veth-ns2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <avr/sleep.h> | |
| // const int com[4] = { 10, 13, 14, 4 }; | |
| // const int com[4] = { 4, 14, 13, 10 }; | |
| // const int dig[8] = { 11, 15, 6, 8, 9, 12, 5, 7 }; | |
| // const int dig[8] = { 13, 17, 4, 6, 7, 14, 3, 5 }; | |
| // const int num[10] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x07, 0x7f, 0x6f }; | |
| // int nmd[10] = {}; | |
| // int nmb[10] = {}; |