Skip to content

Instantly share code, notes, and snippets.

View digiltd's full-sized avatar

Sam Turner digiltd

View GitHub Profile
@digiltd
digiltd / default.rules
Last active October 20, 2015 08:50
Fake detect double click in OpenHAB
// source https://groups.google.com/d/msg/openhab/TnIqLpjIfZo/KFIcvgpxwL4J
import org.openhab.core.library.types.*
import org.openhab.core.persistence.*
import org.openhab.model.script.actions.*
import org.joda.time.*
var DateTime lastClickWallSwitch = new DateTime()
rule "Wall Switch Count Double Click"
@digiltd
digiltd / logback.xml
Last active December 30, 2016 19:28
My openHAB logback config, that breaks up the log based on file size and limits the amount of archives
<configuration scan="true">
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%-5level] [%-30.30logger{36}:%-5line] - %msg%n</pattern>
</encoder>
</appender>
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
@digiltd
digiltd / toggle-vpn.applescript
Last active September 16, 2015 13:17
Toggle the VPN on OSX
tell application "System Events"
tell current location of network preferences
set VPN to "Private Internet Access"
set VPNactive to connected of current configuration of service VPN
if VPNactive then
disconnect service VPN
say "The VPN has been disconnected"
display notification "VPN Disconnected" with title "Toggle VPN"
else
connect service VPN
@digiltd
digiltd / functions.php
Last active September 14, 2015 15:53
Enable wordPress excerpt on page post types
<?php
/**
* Enables the Excerpt meta box in Page edit screen.
*/
function wpcodex_add_excerpt_support_for_pages() {
add_post_type_support( 'page', 'excerpt' );
}
add_action( 'init', 'wpcodex_add_excerpt_support_for_pages' );
@digiltd
digiltd / keymap.xml
Last active September 4, 2015 19:01
Kodi skin development keymap
<keymap>
<global>
<keyboard>
<F5>XBMC.ReloadSkin()</F5>
<F6>Skin.ToggleSetting(DebugGrid)</F6>
<F7>Skin.ToggleSetting(DebugInfo)</F7>
<F8>Notification(Testing 123,Hello world)</F8>
</keyboard>
</global>
</keymap>
@digiltd
digiltd / Tunnelblick_to_RemoteBuddy.applescript
Last active September 1, 2015 09:21
Load Tunnelblick configs into RemoteBuddy
set remotebuddy_list to {}
tell application "Tunnelblick"
set vpn_list to get name of configurations
end tell
repeat with i from 1 to count of vpn_list
set ind_configuration to item i of vpn_list
set end of remotebuddy_list to i
set end of remotebuddy_list to ind_configuration
@digiltd
digiltd / _functions.php
Last active September 1, 2015 09:24
wordpress remove Mandrill widget from dashboard
<?php
// Remove Mandrill Dashboard Widget
// http://wordpress.org/support/topic/dashboard-widget?replies=3
function sp_remove_wpmandrill_dashboard() {
if ( class_exists( 'wpMandrill' ) ) {
remove_action( 'wp_dashboard_setup', array( 'wpMandrill' , 'addDashboardWidgets' ) );
}
}
add_action( 'admin_init', 'sp_remove_wpmandrill_dashboard' );
@digiltd
digiltd / functions.php
Created July 27, 2015 13:41
WordPres disable Dashboard panels
// disable default dashboard widgets
function disable_default_dashboard_widgets() {
global $current_user;
get_currentuserinfo();
if($current_user->user_level != 1){
// remove_meta_box('dashboard_right_now', 'dashboard', 'core');
// remove_meta_box('dashboard_activity', 'dashboard', 'core');
@digiltd
digiltd / mailplane.css
Last active September 14, 2016 20:31
Mailplane custom CSS
/* slighly tweaked version of Seb Szocinsk's original excellent job
originaly posted in https://groups.google.com/forum/#!topic/mailplaneapp/9IvEMtrih5U */
* {
font-family: "Source Sans Pro";
font-size: 18px;
font-weight: 500;
}
@digiltd
digiltd / check-application-active.applescript
Last active December 3, 2024 10:52
Check if an application is running.
set appName to "Growl"
if application appName is not running then
tell application appName
activate
end tell
return "Not Running"
else
return "Running"
end if