Skip to content

Instantly share code, notes, and snippets.

;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
#!/usr/bin/python
from __future__ import print_function
import argparse
import itertools
import sys
import yaml
script_template = """
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))
#!/usr/bin/env python3
import subprocess
import os
import sys
import time
ssh_host = sys.argv[1]
stdin_pipe = os.pipe()
foo bar baz fuck you
--- 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-
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/ip.h>
int main ()
{
struct in_addr foo = (struct in_addr)0;
}
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/ip.h>
int main ()
{
struct in_addr foo = 0;
}
@hyperair
hyperair / git-gh-setup
Last active July 5, 2017 06:49
Setup pull request fetching for github repo
#!/bin/sh
git remote -v | grep fetch | \
grep -e git@github.com -e git://github -e github: -e gh: | \
while read remote url _; do
if ! git config --get-all "remote.$remote.fetch" | grep -q refs/pull
then
git config --add "remote.$remote.fetch" \
'+refs/pull/*/head:refs/remotes/'"$remote"'/pr/*'
git config --add "remote.$remote.fetch" \
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