Skip to content

Instantly share code, notes, and snippets.

View -
;Basic settings: Layer height: {layer_height} Walls: {wall_thickness} Fill: {fill_density}
;Print time: {print_time}
;Filament used: {filament_amount}m {filament_weight}g
;Filament cost: {filament_cost}
G21 ; metric values
G90 ; absolute positioning
M82 ; set extruder to absolute mode
M107 ; start with the fan off
G92 E0 ; set extruder position to 0
M140 S60 ; get bed heating up
View travis2sh
#!/usr/bin/python
from __future__ import print_function
import argparse
import itertools
import sys
import yaml
script_template = """
View libinput-faster-trackpoint.patch
diff --git a/src/evdev-fallback.c b/src/evdev-fallback.c
index 8a11c68..8bc009b 100644
--- a/src/evdev-fallback.c
+++ b/src/evdev-fallback.c
@@ -176,10 +176,6 @@ fallback_flush_relative_motion(struct fallback_dispatch *dispatch,
dispatch->rel.x = 0;
dispatch->rel.y = 0;
- /* Use unaccelerated deltas for pointing stick scroll */
- if (post_trackpoint_scroll(device, unaccel, time))
View sshping
#!/usr/bin/env python3
import subprocess
import os
import sys
import time
ssh_host = sys.argv[1]
stdin_pipe = os.pipe()
View lspci-after-replugging.patch
--- lspci-ok.txt 2017-09-19 19:05:58.675117067 +0800
+++ lspci-broken.txt 2017-09-19 19:15:30.796992815 +0800
@@ -259,7 +259,6 @@
Latency: 0, Cache Line Size: 128 bytes
Interrupt: pin A routed to IRQ 44
Bus: primary=06, secondary=08, subordinate=38, sec-latency=0
- I/O behind bridge: 00004000-00004fff
Memory behind bridge: c1a00000-c5bfffff
Prefetchable memory behind bridge: 00000000cdc00000-00000000d1cfffff
Secondary status: 66MHz- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- <SERR- <PERR-
View foo.c
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/ip.h>
int main ()
{
struct in_addr foo = (struct in_addr)0;
}
View foo.c
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/ip.h>
int main ()
{
struct in_addr foo = 0;
}
View 50-trackpoint-acceleration.conf
Section "InputClass"
Identifier "trackpoint"
MatchProduct "TPPS/2 IBM TrackPoint"
Option "AccelerationProfile" "2"
Option "AccelerationNumerator" "25"
Option "AccelerationDenominator" "10"
Option "VertScrollDelta" "8"
Option "HorizScrollDelta" "8"
EndSection
View round-edges-demo.scad
$fs = 0.4;
$fa = 1;
epsilon = 0.01;
module bevel_cutout (r)
{
difference () {
translate ([1, 1] * -epsilon)
square (r);