Skip to content

Instantly share code, notes, and snippets.

View bbbenji's full-sized avatar
🛸
Hello, Earth!

Benji bbbenji

🛸
Hello, Earth!
View GitHub Profile
@bbbenji
bbbenji / bootstrap-4-cardinal-direction-range-input.markdown
Last active August 28, 2019 08:52
Bootstrap 4 cardinal direction range input

Bootstrap 4 cardinal direction range input

Range input for selecting cardinal direction and outputting degrees from north using Bootstrap custom-range input and native JavaScript.

A Pen by Benji on CodePen.

License.

Here's the canonical TOML example from the TOML README, and a YAML version of the same. Which looks nicer?

title = "TOML Example"

[owner]

# Airly
- platform: rest
scan_interval: 120
name: Airly
resource: !secret airly_resource
value_template: "{{ value_json['current']['values'][1]['value'] }} {{ value_json['current']['values'][2]['value'] }} {{ value_json['current']['values'][3]['value'] }} {{ value_json['current']['values'][4]['value'] }} {{ value_json['current']['values'][5]['value'] }} {{ value_json['current']['indexes'][0]['level'] }}"
headers:
apikey: !secret airly_apikey
- platform: template
#Custom configuration
SMTP_PORT == 25:587
LOCAL_INTERFACES == <; 0.0.0.0.25 ; 0.0.0.0.587 ; 0.0.0.0.465 ; [::0]:25 ; [::0]:587 ; [::0]:465
smtp_accept_max = 50
spamd_address = 127.0.0.1 783
ACL_SMTP_DATA == acl_custom_check_data
USE = "exiscan"
#Custom ACLs
@bbbenji
bbbenji / add_ftp_users.sh
Last active August 29, 2015 14:24 — forked from janxb/ajenti_additional_ftp_users.sh
Additional FTP users for Ajenti
#!/bin/bash
SET_USERS="usernameone:password:/path/to/web/folder usernametwo:password:/path/to/second/folder"
IFS=' ' read -a USERS <<< "${SET_USERS}"
for SET_USER in ${USERS[@]}; do
IFS=':' read -a USER <<< "${SET_USER}"
NAME=${USER[0]};
PASS=${USER[1]};
DIR=${USER[2]};
(echo $PASS; echo $PASS) | pure-pw useradd $NAME -u www-data -g www-data -d $DIR