This file contains 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
#define MICROSTEPS 8 | |
#define PERIOD_PER_MICROSTEP_200 2 | |
class Stepper { | |
bool current_direction; | |
uint8_t stp, dir, en; | |
uint16_t period; | |
int steps_per_rev, current_step; | |
public: | |
Stepper(uint8_t step_pin, uint8_t dir_pin, uint8_t en_pin, uint16_t steps) { |
This file contains 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 "packetizer.h" | |
Packetizer::Packetizer(Stream *s) : stream(s) {} | |
int print_packet(Stream &s, String m, uint8_t mode=PACKET_NORMAL); | |
int send_packet(Stream &s, byte * message, size_t message_length, uint8_t mode=PACKET_NORMAL); | |
boolean Packetizer::might_have_something() { | |
return stream->available() > 0; | |
} |
This file contains 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
app.cli.add_command(db.cli) |
This file contains 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
from itertools import product | |
def product_bfirst(*args): | |
combos = product(*map(enumerate, args)) | |
in_order = sorted(combos, key= | |
lambda combo: reduce( | |
lambda sum, (n, _): sum + n, combo, 0)) | |
denumerated = map(lambda combo: map(lambda (_, v): v, combo), in_order) | |
return denumerated |
This file contains 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
// copy this near the top of your sketch! | |
// change the numbers here to change print settings | |
// look at your parts kit receipt for numbers that work well with your printer | |
#define DOTS 4 | |
#define HEAT_TIME 127 | |
#define HEAT_INTERVAL 64 | |
#define PRINT_DENSITY 1 | |
#define PRINT_TIMEOUT 3 |
This file contains 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
#ifdef GL_ES | |
precision mediump float; | |
#endif | |
/* | |
HUSL-GLSL v3.2 | |
HUSL is a human-friendly alternative to HSL. ( http://www.husl-colors.org ) | |
GLSL port by William Malo ( https://github.com/williammalo ) | |
Put this code in your fragment shader. | |
*/ |
This file contains 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
export default (at, a = 1, b = 1) => | |
at < 1 ? a : require('.').default(at - 1, b, a + b); |
This file contains 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
$ ./sig.sh ./shortLines poem.txt out.txt 24 USR1 USR2 USR1 USR2 INT | |
✎ For Whom the Bell Tolls | |
⚡ USR1 | |
Input file: sig_pipe.fifo | |
Output file: out.txt | |
✎ John Donne | |
⚡ USR2 | |
Lines read: 2 | |
✎ | |
⚡ USR1 |
This file contains 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
<p>The blue boxes are SVG elements, which should stretch to fill their container, via <code>preserveAspectRatio="none"</code> and <code>viewBox="0 0 100 100"</code>.</p> | |
<p>In the fifth example, the SVG escapes the height that the flexbox layout should be giving it. It's broken in both FireFox and Chrome, in slightly different ways.</p> | |
<p>The issue only appears when the SVG is getting squished vertically. With tall containers, the SVG gets horizontally compressed just fine.</p> | |
<p>In the last example, <code>overflow: hidden</code> on the flex parent is convincing FireFox to squish the SVG to size. However, Chrome just clips it in this case.</p> | |
<input id="mode" type="checkbox" > | |
<label for="mode"> | |
<span class="button" id="wide">wide</span> | |
<span class="button" id="tall">tall</span> | |
</label> |
This file contains 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
import React from 'react'; | |
import css from 'blahcss'; | |
const BlahSFC = ({ title }) => css(( | |
<div> | |
<header> | |
<h1>{title}</h1> | |
<p>some text in the header</p> | |
</header> |
NewerOlder