Skip to content

Instantly share code, notes, and snippets.

View knoopx's full-sized avatar

Víctor Martínez knoopx

View GitHub Profile
@knoopx
knoopx / readme.md
Last active August 19, 2021 04:53
Catalina + Windows 10 + Clover
  • make an extfat partition for windows using disk utility
  • make a bootable windows usb (just format disk as fat32 and rsync iso contents)
  • boot windows installation, press shift+f10 to open a console
  • type diskpart, then list volume to figure out windows extfat partion drive letter
  • type dism /Get-WimInfo /WimFile:D:\Sources\install.wim to figure out what window version to install
  • type dism /Apply-Image /ImageFile:D:\Sources\install.wim /index:1 /ApplyDir:C:\ to install specified version into C:
  • type diskpart, then list partition to figure out EFI partition.
  • type select partition #, then assign to "mount" EFI partition, annotate EFI partition letter.
  • type bcdboot C:\Windows /s E: /f uefi to copy Windows UEFI stuff to EFI partition (E:)
# generates random dates per row
update myjacoti_measurementsession set date_start = (select random_date() where myjacoti_measurementsession.uuid = myjacoti_measurementsession.uuid);
@knoopx
knoopx / class-methods-to-arrow-function-props.js
Last active February 9, 2022 12:01
codemod - rewrite class methods as arrow function properties
const IGNORE = [
'constructor',
'componentDidMount',
'componentDidUpdate',
'componentWillReceiveProps',
'componentWillMount',
'componentWillUpdate',
'componentWillUnmount',
'getChildContext',
'getDefaultProps',
@knoopx
knoopx / MaterialSettingsVisibilityHandler.py
Last active November 17, 2019 14:43
Cura Extended Material Profiles
# Copyright (c) 2017 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
import UM.Settings.Models.SettingVisibilityHandler
class MaterialSettingsVisibilityHandler(UM.Settings.Models.SettingVisibilityHandler.SettingVisibilityHandler):
def __init__(self, parent=None, *args, **kwargs):
super().__init__(parent=parent, *args, **kwargs)
@knoopx
knoopx / setup.sh
Last active December 23, 2018 17:57
raspberry tft
# https://tutorials-raspberrypi.de/lcd-touch-display-teil-2-anpassungen/
# http://projectable.me/raspberry-pi-touchscreen-octoprint-controller/
sudo apt-get install xserver-xorg-video-fbturbo
git clone https://github.com/goodtft/LCD-show.git
LCD-show/LCD35-show 180
# fix framebuffer
/etc/X11/Xwrapper.config -> allowed_users=anybody
/usr/share/X11/xorg.conf.d/99-fbdev.conf
Section "Device"
Identifier "touchscreen"
Driver "fbdev"
Option "fbdev" "/dev/fb1"
EndSection
@knoopx
knoopx / README.md
Last active April 29, 2024 15:37
Creality Ender 3 Stock Factory Vref

Creality3D v1.1.2 stock vref values

A4988 Drivers
Vref set to ~90% of stepper rated current
Rs = 0.1ohm

X = 0,58v (0,725A)
Y = 0,58v (0,725A)
Z = 0,58v (0,725A)
@knoopx
knoopx / shairport.sync.plist
Last active April 7, 2018 16:59
shairport sync launchd (copy to ~/Library/LaunchAgents)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>shairport.sync</string>
<key>Program</key>
<string>/usr/local/bin/shairport-sync</string>
<key>ProgramArguments</key>
<array>
@knoopx
knoopx / tachyons-to-tailwind-transform.js
Last active August 17, 2023 13:51
Transform tachyons classes to tailwind css (using babel-codemod)
// Installation:
// yarn add -D @codemod/cli @babel/plugin-syntax-jsx @babel/generator
import jsx from "@babel/plugin-syntax-jsx"
import generate from "@babel/generator"
const COLOR_MAP = {
"white": "white",
"near-white": "gray-100",
"light-gray": "gray-200",
@knoopx
knoopx / gist:8d7fcfc8f2f556d4e4fb1b4bbd193034
Last active August 9, 2017 12:06
chrome headless pdf generation
const fs = require('fs')
const CDP = require('chrome-remote-interface')
async function waitForNode(client, selector, waitTimeout) {
const { Runtime } = client
const getNode = selector => document.querySelector(selector)
const result = await Runtime.evaluate({
expression: `(${getNode})(\`${selector}\`)`,
})