Skip to content

Instantly share code, notes, and snippets.

G91 ; Relative positioning for all axes
G92 E0
G1 E-8 F3600 ; retract 5mm at 60mm/s
G0 Z20 F4800
G28 X0 ; home x axis
M106 S0 ; turn off cooling fan
M104 S0 ; turn off extruder
M140 S0 ; turn off bed
M84 ; disable motors
import mmh3
import array
import math
import matplotlib.pyplot as plt
import numpy as np
class CMSketch(object):
def __init__(self):
@UndeadKernel
UndeadKernel / orbsmart_am-1.xml
Last active July 15, 2017 12:07
Kodi keymaps
app.xml:
<keymap>
<global>
<appcommand>
<browser_home>PreviousMenu</browser_home>
<launch_mail>stop</launch_mail>
</appcommand>
</global>
</keymap>
@UndeadKernel
UndeadKernel / advancedsettings.xml
Created June 9, 2017 22:47
Good parsing settings for Kodi
<advancedsettings>
<video> <!-- Stop XBMC indexing some unwanted common items -->
<excludetvshowsfromscan action="prepend">
<regexp>(?i)sample</regexp> <!-- Greedy, whole path, case insensitive ignore -->
<regexp>(?i)uTorrentPartFile</regexp> <!-- Ignore common scrap files -->
<regexp>[\/\\][sS]pecials?[\/\\]</regexp>
<regexp>[\/\\][Ee]xtras?[\/\\]</regexp>
<regexp>(?i)[\. \-_](?:nc)?(?:op|ed|sp|pv)[\. \-_\(\[\d]</regexp>
</excludetvshowsfromscan>
</video>
@UndeadKernel
UndeadKernel / pca.py
Created February 17, 2017 15:26
Simple PCA implementation in Python(3)
class PCA:
def __init__(self):
self.e_values = None
self.e_vectors = None
self.mean_data = None
# Find all eigenvalues and eigenvectors
# data -> instances as rows
def prepare(self, data):
# Substract mean
# Change the default escape key to `
escape ``
# Automatically change the title of the screen.
shelltitle '$ |'
# Windows start from number 1 instead of 0
bind c screen 1
bind ^c screen 1
bind 0 select 10