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 / 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")
@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 / 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 / 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 / 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 <atnbueno@gmail.com>
// @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 / shortcut-preview.user.js
Last active June 1, 2023 18:49
Greasemonkey: Add "Preview" button to iOS shortcut's iCloud links, linking to showcuts.app, and fixes the icon CSP bug
// ==UserScript==
// @name iOS Shortcut Preview
// @namespace https://www.atnbueno.com/
// @match https://showcuts.app/share/view
// @match https://www.icloud.com/shortcuts/*
// @version 2.0
// @grant GM_addStyle
// ==/UserScript==
/*
Time Title
0:00:00 (King George's Intro)
0:01:05 Alexander Hamilton
0:05:07 Aaron Burr, Sir
0:07:38 My Shot
0:13:45 The Story of Tonight
0:15:13 The Schuyler Sisters
0:18:23 Farmer Refuted
0:20:13 You'll Be Back
0:23:50 Right Hand Man
@atnbueno
atnbueno / click-to-delete.user.js
Last active August 22, 2023 04:29
A userscript to delete page elements when clicked twice while pressing Alt, Control, and Shift simultaneously
// ==UserScript==
// @name Click to delete
// @author Antonio Bueno
// @namespace userscripts.atnbueno.com
// @description This script deletes page elements if clicked twice while simultaneously pressing Alt, Control, and Shift
// @version 2.0
// @grant none
// ==/UserScript==
/*
@atnbueno
atnbueno / widget-html-css-scriptable-jobs.js
Created September 23, 2020 14:49 — forked from dcatanzaro/widget-html-css-scriptable-jobs.js
Widget con HTML y CSS en Scriptable
//Twitter: https://twitter.com/DamianCatanzaro
const html = "<html> \
<head> \
<style> \
body { \
margin: 0; \
background-color: cyan; \
width: 500px; \
height: 500px; \
@atnbueno
atnbueno / iphone-colors.css
Created November 29, 2020 16:21
Official iPhone colors according to apple.com/iphone/compare/ (also leather and silicone case colors)
/* basic colors */
.black { color: #2e3034 }
.gold { color: #e3ccb4 }
.jetblack { color: #000000 }
.rosegold { color: #ecc6c1 }
.silver { color: #e2e3e4 }
.spaceblack { color: #1c1d1e }
.spacegray { color: #b1b2b7 }