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 5, 2025 06:26
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}\`)`,
})
@knoopx
knoopx / decorate-class-autobind.js
Created September 1, 2016 22:49
jscodeshift decorate autobind
export default (file, api) => {
const j = api.jscodeshift
const root = j(file.source)
if (root.find(j.ExportDefaultDeclaration).get().value.declaration.decorators.map(n => n.expression.name).indexOf("autobind") >= 0) { return null }
root.get().value.program.body.splice(1, 0, j.importDeclaration([j.importSpecifier(j.identifier('autobind'))], j.literal('core-decorators')))
root.find(j.ExportDefaultDeclaration).get().value.declaration.decorators.push(j.decorator(j.identifier('autobind')))
return root.toSource()
}
@knoopx
knoopx / filter.rb
Last active November 18, 2015 16:14
module FiltrableModel
def filter_class=(klass)
@filter_class = klass
end
def filter(params = {})
@filter_class or raise "No filter model specified"
@filter_class.new(self).apply(params)
end
end
@knoopx
knoopx / pre-recieve
Last active October 4, 2015 15:11
git push based deployment
#!/usr/bin/env bash
set -xeuf -o pipefail
export DEPLOY_PATH="/home/deploy/mindo.io"
export CURRENT_PATH="$DEPLOY_PATH/current"
export REPO_PATH="$DEPLOY_PATH/repo"
export SHARED_PATH="$DEPLOY_PATH/shared"
export RELEASE_PATH="$DEPLOY_PATH/releases/$(date +%s)"
@knoopx
knoopx / gist:cee46e6267f429cc1fd9
Created April 29, 2015 15:54
parallell-rspec
#!/usr/bin/env bash -e
set -euo pipefail
shopt -s globstar
shopt -s extglob
export RUBY_HEAP_MIN_SLOTS=2000000
export RUBY_HEAP_FREE_MIN=20000
export RUBY_GC_MALLOC_LIMIT=100000000
@knoopx
knoopx / bootstrap.sh
Last active August 29, 2015 14:20
Bootstrap new servers
#!/bin/bash
# http://winstonyw.com/2014/10/24/setting_up_ruby_on_rails_on_digital_ocean/
# https://github.com/mattdbridges/capistrano-recipes/blob/master/postgresql.rb
set -euo pipefail
LOCALE="en_US.utf8"
TIMEZONE="Europe/Madrid"
ADMIN_USER="admin"
@knoopx
knoopx / gist:a6966f6df65680df6b2c
Created October 17, 2014 14:07
change osx shell for current user
sudo dscl . -create ~ UserShell `which fish`