Skip to content

Instantly share code, notes, and snippets.

Avatar
🦔

Scott Evans scottsweb

🦔
View GitHub Profile
@scottsweb
scottsweb / photobooth
Created Feb 21, 2016
init.d script for Photobooth
View photobooth
#!/bin/bash
### BEGIN INIT INFO
# Provides: photobooth
# Required-Start: $local_fs
# Required-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start or stop the photobooth server
### END INIT INFO
@scottsweb
scottsweb / unicorn
Last active Aug 31, 2015
init.d script for Unicorn Hat (Python script as root)
View unicorn
#!/bin/bash
### BEGIN INIT INFO
# Provides: unicorn
# Required-Start: $local_fs $remote_fs $network
# Required-Stop: $local_fs $remote_fs $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start or stop the unicorn hat server
### END INIT INFO
@scottsweb
scottsweb / node-red
Last active Aug 31, 2015
init.d script for Node-RED
View node-red
#!/bin/bash
### BEGIN INIT INFO
# Provides: node-red
# Required-Start: $local_fs $remote_fs $network
# Required-Stop: $local_fs $remote_fs $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start or stop the node-red server
### END INIT INFO
@scottsweb
scottsweb / gmail.py
Last active Aug 29, 2015
Send Email via Gmail with Python
View gmail.py
#!/usr/bin/python
import argparse
import os
import smtplib
from smtplib import SMTP_SSL
from email.mime.multipart import MIMEMultipart
from email.mime.base import MIMEBase
from email.mime.text import MIMEText
from email import encoders
View dashicons.php
<?php
$icons = array(
'menu-icon-dashicons-menu' => __('Menu', 'iconic'),
'menu-icon-dashicons-dashboard' => __('Dashboard', 'iconic'),
'menu-icon-dashicons-admin-site' => __('Admin Site', 'iconic'),
'menu-icon-dashicons-admin-media' => __('Admin Media', 'iconic'),
'menu-icon-dashicons-admin-page' => __('Admin Page', 'iconic'),
'menu-icon-dashicons-admin-comments' => __('Admin Comments', 'iconic'),
'menu-icon-dashicons-admin-appearance' => __('Admin Appearance', 'iconic'),
@scottsweb
scottsweb / eu.php
Last active Apr 8, 2021
An array of EU country codes.
View eu.php
<?php
$eu_countries = array(
"AT" => "Austria",
"BE" => "Belgium",
"BG" => "Bulgaria",
"HR" => "Croatia",
"CY" => "Cyprus",
"CZ" => "Czech Republic",
"DK" => "Denmark",
@scottsweb
scottsweb / gravity-forms-validation.php
Last active May 26, 2017
Using a Gravity Forms filter to create a custom validation and check for existing UID in already saved entries.
View gravity-forms-validation.php
<?php
/***************************************************************
* Function media_custom_validation
* Check the media form for duplicate inputs on the same day
***************************************************************/
add_filter('gform_validation', 'media_custom_validation');
function media_custom_validation($validation_result) {