Skip to content

Instantly share code, notes, and snippets.

View fvdm's full-sized avatar
🦖
I may be slow to respond

Franklin fvdm

🦖
I may be slow to respond
View GitHub Profile
@fvdm
fvdm / homeyscript_waitms.js
Last active February 17, 2024 12:54
HomeyScript to stall the flow a number of minutes, seconds or millieconds (default)
/**
* HomeyScript to stall the flow a number of [m]inutes, [s]econds or [m]illi[s]econds (default)
*
* @example 2 -> waiting 2ms
* @example 2m -> waiting 2 min
* @example 2s -> waiting 2 seconds
*
* @see {@link https://gist.github.com/fvdm/23a77945799d204512877caf87aee9a2}
*/
@fvdm
fvdm / homeyscript_parseint.js
Last active February 17, 2024 12:40
HomeyScript to parse an integer from any argument type within a flow. The result is provided in the `value` tag. You can optionally set a different output type: `number` (default), `string` or `bool`.
/**
* Parse the argument to an integer of `number` type.
* Optionally you can enforce the output type to `number` (default), `string` or `bool`.
* The result is provided in the `value` tag.
*
* @example '22:00' -> 22
* @example '22:00 string' -> '22'
* @example '22:00 bool' -> true
* @example '0 bool' -> false
*
@fvdm
fvdm / homeyscript_datum.js
Last active April 10, 2024 21:28
HomeyScript for simple date calculation within a flow. The date class is using the timezone configured in the Homey settings. The result is provided as card tags which can be used in cards that come after. Make sure to add delays to the cards that use these tags, because HomeyScripts are executed async.
/**
* Get current date and time as card tags
* Optional date offset calculation using Homey's timezone
* suffix: [y]ears, [m]onths, [d]ays, [h]ours, m[i]nutes, [s]econds, [m]illi[s]econds
*
* @example
* // two months ago
* '-2m'
*
* @example

Keybase proof

I hereby claim:

  • I am fvdm on github.
  • I am fvdm (https://keybase.io/fvdm) on keybase.
  • I have a public key ASAS4VBijLQUJfPqff4YybLRQpbqtJpvFjCJmj7hqaO1Uwo

To claim this, I am signing this object:

@fvdm
fvdm / gist:840d4bf427428415ea9ec3652aca78de
Last active December 4, 2017 21:53 — forked from chrissimpkins/gist:5bf5686bae86b8129bee
Atom Editor Cheat Sheet (Sweetmeat)

Use these rapid keyboard shortcuts to control the GitHub Atom text editor on Mac OSX.

Key to the Keys

key name
Command key
Option or Alt key
Control key
Shift key
@fvdm
fvdm / Resource abuse.1blockpkg
Last active November 26, 2017 15:38
1Blocker package - anti resource abuse/cryptomining scripts - based on other lists
[
{
"id": "EC1657C2-44A7-446C-8E2F-D2D6D2A9BAB1",
"name": "Resource abuse",
"rules": [
{
"content": {
"action": {
"type": "block"
},
@fvdm
fvdm / Three Wise Monkeys.md
Created July 19, 2017 11:41 — forked from malarkey/Three Wise Monkeys.md
Three Wise Monkeys (NDA)

Date: [date]

Between us [company name] and you [customer name].

Summary:

In short; neither of us will share any confidential information about each-other, by any means, with anyone else.

What’s confidential information?

@fvdm
fvdm / homebrew.mxcl.pdnsrec.plist
Created July 7, 2017 20:46 — forked from kometchtech/homebrew.mxcl.pdnsrec.plist
powerdns recursor for Mac OSX
<?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>homebrew.mxcl.pdnsrec</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/opt/pdnsrec/sbin/pdns_recursor</string>
</array>
@fvdm
fvdm / remove-tinymce-editor-buttons.php
Created June 30, 2017 22:06 — forked from JiveDig/remove-tinymce-editor-buttons.php
Remove buttons/items from the WordPress TinyMCE editor
<?php
/**
* Removes buttons from the first row of the tiny mce editor
*
* @link http://thestizmedia.com/remove-buttons-items-wordpress-tinymce-editor/
*
* @param array $buttons The default array of buttons
* @return array The updated array of buttons that exludes some items
*/
add_filter( 'mce_buttons', 'jivedig_remove_tiny_mce_buttons_from_editor');
@fvdm
fvdm / nginx_status_codes.py
Created February 17, 2017 15:05 — forked from bactisme/nginx_status_codes.py
Very simple munin plugin to graph nginx HTTP error codes
#!/usr/bin/python
# ALL FAME GOES HERE : https://gist.github.com/mipearson/1146151
#
# 1/ Place where you want (like /usr/share/munin/plugins/nginx_status_codes.py )
# 2/ Link in /etc/munin/plugins/ :
# ln -s /usr/share/munin/plugins/nginx_status_codes.py /etc/munin/plugins/nginx_errors
# chmod +x /etc/munin/plugins/nginx_errors
# 3/ Test with
# munin-run nginx_errors
# 4/ If nescessary : add these lines in your munin conf