Skip to content

Instantly share code, notes, and snippets.

View subtubes-io's full-sized avatar
👷‍♂️
Building things

subtubes subtubes-io

👷‍♂️
Building things
  • Napa, California
View GitHub Profile
@subtubes-io
subtubes-io / gist:63c0ab295196885df56a073bc557abcc
Created February 20, 2024 21:37
G-Code for Bambulabs P1S and X1 to pause and lower bed
G91 ; Set relative positioning
G0 Z100 ; Lower bed 100 mm
M400 U1 ; Pause for user interaction
G0 Z-100 ; Raise bed back to original position
G90 ; Back to absolute positioning...
M83 ; ...but extruder relative!
#!/usr/bin/env bash
# attribution to http://mikeberggren.com/post/53883822425/ncudp
echo -n “foo” | nc -4u -w1 <host> <udp port>
#Here’s quick breakdown of what’s happening:
#-n - Tells the echo command to not output the trailing newline.
#-4u Use IPV4 addresses only. Use UDP instead of TCP.
#-w1 Silently close the session after 1 second of idle time. That way, we’re not stuck waiting for more data.
@subtubes-io
subtubes-io / gist:b5caa3f12563a87b86a3
Created June 3, 2015 05:34
Extending AngularJs Directives
'use strict';
angular.module('extndApp')
.directive('parent', function () {
return {
template: '<div>' +
'<ul>' +
'<li>Hello</li>' +
'<li>World</li>' +
'<li>Foo</li>' +
@subtubes-io
subtubes-io / gulpfile.js
Last active August 29, 2015 14:14
Gulp task to inject modular angularjs and bower dependencies
var gulp = require('gulp');
var inject = require("gulp-inject");
var wiredep = require('wiredep').stream;
gulp.task('default', function () {
var target = gulp.src('./app/index.html');
var sources = gulp.src([
'./app/scripts/**/*.module.js',
@subtubes-io
subtubes-io / introrx.md
Last active August 29, 2015 14:13 — forked from staltz/introrx.md

The introduction to Reactive Programming you've been missing

(by @andrestaltz)

So you're curious in learning this new thing called Reactive Programming, particularly its variant comprising of Rx, Bacon.js, RAC, and others.

Learning it is hard, even harder by the lack of good material. When I started, I tried looking for tutorials. I found only a handful of practical guides, but they just scratched the surface and never tackled the challenge of building the whole architecture around it. Library documentations often don't help when you're trying to understand some function. I mean, honestly, look at this:

Rx.Observable.prototype.flatMapLatest(selector, [thisArg])

Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.

@subtubes-io
subtubes-io / gist:69d853b5856a7eb7b596
Created December 20, 2014 22:02
Traverse a directory structure recursively with "fs" and node.js
var fs = require("fs");
function travese(path, seperator) {
var parts = path.split("/"),
last = parts[parts.length - 1],
files;
seperator = seperator || "";
@subtubes-io
subtubes-io / gist:3cfc973cbf1cd39010dd
Created December 16, 2014 17:13
Transitionables in Famo.us
define(function (require, exports, module) {
"use strict";
var Engine = require("famous/core/Engine"),
Surface = require("famous/core/Surface"),
Transitionable = require("famous/transitions/Transitionable"),
Modifier = require("famous/core/Modifier"),
Transform = require("famous/core/transform");
var item = 4;
var sum = itemFunc() + 2;
item = 3;
function itemFunc(){return item;}
console.log(sum);
@subtubes-io
subtubes-io / bower.json
Last active August 29, 2015 14:07
Sample NPM Karma Unit Test Setup
{
"name": "unittests",
"version": "0.0.0",
"authors": [
"edgarmartinez <example@example.com>"
],
"moduleType": [
"globals"
],
"license": "MIT",
layout.header.add(new StateModifier({
transform: Transform.translate(0,0,1)
})).add(new Surface({
size: [undefined, 75],
content: "Header",
properties: {
lineHeight: "75px",
textAlign: "center",
color: "white",