Skip to content

Instantly share code, notes, and snippets.

Vftdan /
Created Aug 9, 2019
Convert pal to gpl palette
#! /usr/bin/env python3
input() #header
input() #version
cnt = int(input()) #number of colors
print("GIMP Palette")
print("Columns: {0}".format(cnt))
for i in range(cnt):
print("{0} {1} {2}\tUntitled".format(*(input().split())) + str(i + 1))
Vftdan /
Last active Jan 7, 2019 — forked from nikhilw/
Toggle mic on-off on a Ubuntu / Linux Mint machine with a keyboard shortcut
#! /bin/sh
# static icon, easier to set as a bash alias or directly use as a single command instead of creating a script file.
amixer -D pulse set Capture toggle | gawk 'match($0, /(Front Left|Mono).*\[(.*)\]/, a) {print a[2]}' | xargs notify-send --hint=int:transient:1 -i "audio-input-microphone" "Mic switched: $1"
View hse_logo.gcode
M104 S200
G1 Z5 F250.0
M109 S200
Vftdan / toggleSide
Created Nov 23, 2018
"javascript:" bookmarks for
View toggleSide
View button.gcode
G0 X11.0
G2 X11.0 Y22.0 I0.0 J11.0
G2 X11.0 Y0.0 I-0.0 J-11.0
G0 Z0.1
G2 X11.0 Y22.0 I0.0 J11.0
G2 X11.0 Y0.0 I-0.0 J-11.0
G0 Z0.2
G2 X11.0 Y22.0 I0.0 J11.0
G2 X11.0 Y0.0 I-0.0 J-11.0
View soap-container-manual.gcode
G0 X2 Y8 Z0
G1 F60 E.0024
(M98 P1 L30)
G1 X4
G1 Y-.1
G1 X-4
G1 Y-.1
G1 X4
Vftdan / Func8.tsv
Last active Dec 8, 2018
Turing Machine program for function F(A, B, C) = A and (B equiv C)
View Func8.tsv
Q\A _ * 0 1 x Комментарии
IN halt * l q1 0 l q1 1 l q1
q1 * r LP
LP _ l q2 * r LP 0 r LP 1 r LP x r LP
q2 * n C0 _ l C0 _ l C1
C0 * l q3 0 l C0 1 l C0
q3 * n D1 x l D1 x l D0 x l q3
C1 * l q4 0 l C1 1 l C1
q4 * n D0 x l D0 x l D1 x l q4
D0 * l q5 0 l D0 1 l D0
Vftdan /
Created Nov 8, 2018
Turing machine interpreter. Usage: `python program.tsv inputs.txt`
import sys
class ParsingException(BaseException):
class TuringException(BaseException):
header = None
data = dict()
dataptr = 0
states = dict()
stateptr = None
View mathcad_L1_a_c.xmcd
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?validation-md5-digest 17f0e79d174143dc72e8ed7517deb334?>
<worksheet version="3.0.3" xmlns="" xmlns:xsi="" xmlns:ws="" xmlns:ml="" xmlns:u="" xmlns:p="">
<generator>Mathcad Professional 14.0</generator>
<author>Пользователь Windows</author>
View soap-container.scad
//by Vftdan
module detSphere(radius, details=1) scale(1 / details) sphere(radius * details);
module zcyl(h, r, details) scale(1 / details) cylinder(h * details, r=r * details, center=true);
module xcyl(h, r, details) rotate([0, 90, 0]) zcyl(h, r, details);
module ycyl(h, r, details) rotate([90, 0, 0]) zcyl(h, r, details);
module bottomSmoothedCuboid(width, depth, height, radius, details=1) {
d = radius * 2;
intersection() {
translate([0, 0, height / 2]) {