Skip to content

Instantly share code, notes, and snippets.

View atnbueno's full-sized avatar
👨‍💻
🏴󠁵󠁳󠁣󠁡󠁿 Girona, Spain ⌚UTC+2

Antonio Bueno atnbueno

👨‍💻
🏴󠁵󠁳󠁣󠁡󠁿 Girona, Spain ⌚UTC+2
View GitHub Profile
@atnbueno
atnbueno / template.user.js
Last active May 25, 2024 15:39
My starting point for Violentmonkey userscripts
// ==UserScript==
// @name Website tweaks
// @version 1.4
// @author Antonio Bueno <[email protected]>
// @namespace userscripts.atnbueno.com
// @match http://www.example.com/*
// @require https://cdn.jsdelivr.net/npm/jquery@3/dist/jquery.min.js
// @require https://cdn.jsdelivr.net/npm/toastify-js
// @resource toastifyCSS https://cdn.jsdelivr.net/npm/toastify-js/src/toastify.min.css
// @grant GM_addStyle
@atnbueno
atnbueno / parametrization.scad
Created March 29, 2018 15:02
Example of 3D parametrization with OpenSCAD
/* EXAMPLE OF 3D PARAMETRIZATION WITH OPENSCAD
© 2018 Antonio Bueno
https://github.com/atnbueno
The content of this file is licensed under the terms of the MIT
license: <https://opensource.org/licenses/MIT>
DESCRIPTION: An example of 3D parametrization a.k.a. how to wrap
a bidimentional interval around a 3D shape. The code below makes
a weak attempt to minimize the distortion of the triangulation,
@atnbueno
atnbueno / rotate_extrude_angle.scad
Last active January 26, 2016 20:59
An OpenSCAD script to get a partial rotate_extrude
rotate_extrude_angle(90) translate([10, 0, 0]) circle(5);
// A workaround until the new "angle" parameter of rotate_extrude arrives to the public release
module rotate_extrude_angle(angle, r=9999) {
intersection() {
rotate_extrude() children(0);
translate([0, 0, -r/2]) linear_extrude(r) circle_sector(r, 0, angle); // see below
}
}
@atnbueno
atnbueno / OpenSCAD_viewport_resize.ahk
Last active January 25, 2016 15:52
A simple AutoHotkey script to resize an OpenSCAD window in order to get a 1280x720 viewport
; AutoHotkey Version: AutoHotkey 1.1 (Unicode x86)
; Language: English
; Platform: Win7 SP1
; Author: Antonio Bueno <user atnbueno at Google's free e-mail service>
; Description: Win+R resizes an OpenSCAD window in order to get a 1280x720 viewport
; Last Mod: 2016-01-25
; The desired viewport dimensions
nNewWidth := 1280
nNewHeight := 720
@atnbueno
atnbueno / GetDropboxFolder.ahk
Last active April 7, 2020 11:30
How to get where's the Dropbox folder
If FileExist(A_AppData "\Dropbox\host.db") {
FileReadLine, EncodedDropboxFolder, % A_AppData "\Dropbox\host.db", 2
MsgBox, 0x40, % "Get Dropbox folder", % "Read from host.db:`n" EncodedDropboxFolder "`n`nDecoded as Base64:`n" Base64ToString(EncodedDropboxFolder)
} Else {
MsgBox, 0x10, % "Get Dropbox folder", % "ERROR: host.db file not found"
}
; Based on code by Laszlo, found at http://autohotkey.com/board/topic/35618-/?p=224660
Base64ToString(sBase64) {
DllCall("Crypt32.dll\CryptStringToBinary", UInt,&sBase64, UInt,StrLen(sBase64), UInt,1, UInt,0, UIntP,nSize, UInt,0, UInt,0, "CDECL UInt")