Skip to content

Instantly share code, notes, and snippets.

@SippieCup
SippieCup / transformerToCNNTransformer.py
Last active August 24, 2024 04:23
Example implementation from a basic Transformer model to CNNTransformer.
import torch
import torch.nn as nn
import torch.nn.functional as F
class CNNTransformer(nn.Module):
def __init__(self, input_dim, hidden_dim, output_dim, num_layers, kernel_size):
super(CNNTransformer, self).__init__()
self.convs = nn.ModuleList([
nn.Conv1d(in_channels=input_dim if i == 0 else hidden_dim,
out_channels=hidden_dim,
@SippieCup
SippieCup / palettes.scss
Last active March 20, 2024 20:38
Defining multipl palettes, themed & success/warn/danger
@use '@angular/material' as mat;
$md-palette: (
50 : #e3e6ea,
100 : #b9c0cb,
200 : #8a96a9,
300 : #5b6b86,
400 : #374c6c,
500 : #142c52,
@SippieCup
SippieCup / printer.cfg
Last active November 10, 2023 22:58
E5P + Mercury One.1 CoreXY + Sensorless Homing + SKR2 + TFT35 + StealthBurner + Voron Tap + CAN Bus Toolhead + Voron Revo
# This file contains common pin mappings for the BigTreeTech SKR 2.
# To use this config, the firmware should be compiled for the
# STM32F407 with a "32KiB bootloader".
# In newer versions of this board shipped in late 2021 the STM32F429
# is used, if this is the case compile for this with a "32KiB bootloader"
# You will need to check the chip on your board to identify which you have.
#
# The "make flash" command does not work on the SKR 2. Instead,
# after running "make", copy the generated "out/klipper.bin" file to a
INT. BATMAN'S PALACE - DAY
Batman is sitting in his throne room, looking out the window. Suddenly, he hears a noise and looks over to see a small, black object flying towards him. He realizes it's a bat and tries to shoo it away, but it keeps coming towards him.
Suddenly, the bat changes course and starts flying around the room in a weird pattern. Batman gets up and tries to follow it, but it's too fast. Suddenly, it stops and hangs upside down from the chandelier.
Batman: What the hell do you want?
The bat just hangs there, eerily silent.
@SippieCup
SippieCup / story 1
Last active September 13, 2022 15:39
AI Powered batman
The scene is set at the batcave. Batman is preparing to go out on patrol.
Alfred: Master Bruce, are you sure you don't want me to go with you?
Batman: No, Alfred. I have to do this alone.
Alfred: But sir, with all the recent attacks on you, I don't think it's wise for you to go out alone.
# Maintainer: Salamandar <felix@piedallu.me>
pkgname=prusa-slicer-git
pkgver=2.6.0.alpha0.r149.g60cd7d456
pkgrel=1
pkgdesc='G-code generator for 3D printers (RepRap, Makerbot, Ultimaker etc.)'
arch=('i686' 'x86_64' 'armv6' 'armv6h' 'armv7h')
url='https://github.com/prusa3d/PrusaSlicer'
license=('AGPL3')
makedepends=(
@SippieCup
SippieCup / PKGBUILD
Last active July 23, 2022 23:21
prusa-slicer-git fix PKG build
# Maintainer: Salamandar <felix@piedallu.me>
pkgname=prusa-slicer-git
pkgver=2.6.0.alpha0.r149.g60cd7d456
pkgrel=1
pkgdesc='G-code generator for 3D printers (RepRap, Makerbot, Ultimaker etc.)'
arch=('i686' 'x86_64' 'armv6' 'armv6h' 'armv7h')
url='https://github.com/prusa3d/PrusaSlicer'
license=('AGPL3')
makedepends=(
@SippieCup
SippieCup / Start.gcode
Created July 18, 2022 15:57
start/end gcodes for e5p with UBL
G90 ; use absolute coordinates
M83 ; extruder relative mode
M104 S120 ; set temporary nozzle temp to prevent oozing during homing and auto bed leveling
M140 S[first_layer_bed_temperature] ; set final bed temp
M190 S[first_layer_bed_temperature] ; wait for bed temp to stabilize
G28 ; home all axis
; UBL bed leveling
;G29 P1
;G29 P3
proxy_http_version 1.1;
proxy_cache_bypass $http_upgrade;
# Proxy headers
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
@SippieCup
SippieCup / listener.sh
Last active August 4, 2021 22:01
Find and fills all available free space in root dir.
#!/bin/bash
ROOT=$1
PORT=$2
DELETE=$3
free_space () {
FREE_SPACE=$(df $1 | awk '{print $4}' | tail -n 1)
#echo $FREE_SPACE
echo $(($FREE_SPACE/1048576))