Skip to content

Instantly share code, notes, and snippets.

View sidharrell's full-sized avatar

Sidney Harrell sidharrell

  • Vivian-Harrell Web Development Studios, LLC
  • Harpers Ferry, WV, United States
View GitHub Profile
@sidharrell
sidharrell / gist:ebe5e09e8fde8225d44b
Created March 25, 2015 00:29
fstab entries for external drives
UUID=0367-83D9 /home/sidney/Mount/video_fiction_2 vfat async,auto,rw,user,uid=1000,gid=1000 0 0
UUID=F474B7AA74B76DCC /home/sidney/Mount/mix ntfs async,auto,rw,user,uid=1000,gid=1000 0 0
UUID=A2E8CC08E8CBD925 /home/sidney/Mount/video_fiction_1 ntfs async,auto,rw,user,uid=1000,gid=1000 0 0
UUID=9B98-9ADB /home/sidney/Mount/video_nonfiction_1 vfat async,auto,rw,user,uid=1000,gid=1000 0 0
UUID=4C77-09B3 /home/sidney/Mount/video_nonfiction_2 vfat async,auto,rw,user,uid=1000,gid=1000 0 0
@sidharrell
sidharrell / gist:7b63c4c24aeb453bb8dd
Created March 22, 2015 22:12
spotify alarm command
dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.OpenUri string:spotify:user:sidharrell:playlist:2ycW6R4SRTPEIFru2YB2Uq
<?php
use Drupal\Core\Config\Schema\SchemaCheckTrait;
/**
* Implements hook_drush_command().
*/
function ef_drush_command() {
$items['schema-validate'] = [
'description' => dt('Validates all config schemaj'),
];
@sidharrell
sidharrell / gist:54c9cf75f6328f35c4b3
Last active August 29, 2015 14:15
debug to file
if(\Drupal::service('kernel')) { // make a conditional test for debug or not
ob_start();
// insert var below
var_dump(true);
// insert var above
$data = ob_get_clean();
$fp = fopen("textfile.html", "a");
// write $data or custom string, ie "I'm here".
fwrite($fp, "true");
@sidharrell
sidharrell / espresso-delete-transients.php
Created February 9, 2015 17:10
Delete Expired EE4 Session Transients plugin
<?php
/*
Plugin Name: Event Espresso - Delete Expired EE4 Session Transients
Plugin URI: http://www.eventespresso.com/
Description: Deletes Expired EE4 Session Transients. Requires version of Event Espresso 4 and greater.
Version: 0.0.1
Author: Event Espresso
Author URI: http://www.eventespresso.com
Copyright (c) 2014 Event Espresso All Rights Reserved.
@sidharrell
sidharrell / espresso_delete_orphaned_session_transients.php
Created February 9, 2015 17:08
Delete orphaned session transients
/**
* espresso_delete_orphaned_session_transients
* @param int $expired_session_transient_delete_query_limit
*/
function espresso_delete_orphaned_session_transients( $expired_session_transient_delete_query_limit ) {
global $wpdb;
// DELETE ORPHANED SESSION TRANSIENTS
$SQL = "
SELECT option_name
FROM wp_options
@sidharrell
sidharrell / gist:8da2c256c5ab6921ddf7
Created February 6, 2015 19:21
more entropy in reg ids
//Build the registration id
function espresso_build_registration_id_custom($event_id){
remove_filter('filter_hook_espresso_registration_id', 'espresso_build_registration_id', 10, 1);
return uniqid($event_id . '-', true);
}
//Registration id filter
add_filter('filter_hook_espresso_registration_id', 'espresso_build_registration_id_custom', 8, 1);
@sidharrell
sidharrell / gist:5fe35bf67e10bb118ce8
Created February 5, 2015 17:47
wp-debug to file
/**
* This will log all errors notices and warnings to a file called debug.log in
* wp-content only when WP_DEBUG is true. if Apache does not have write permission,
* you may need to create the file first and set the appropriate permissions (i.e. use 666).
*/
define( 'WP_DEBUG', true ); // Or false
if ( WP_DEBUG ) {
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
@sidharrell
sidharrell / gist:ac831708ae44838d5fe5
Created January 25, 2015 08:23
sublime_user_settings
{
"bold_folder_labels": true,
"caret_style": "wide",
"default_line_ending": "unix",
"ensure_newline_at_eof_on_save": true,
"fallback_encoding": "UTF-8",
"find_selected_text": true,
"font_options":
[
"subpixel_antialias"
@sidharrell
sidharrell / gist:b4368fa538fac4ee1441
Created January 25, 2015 08:19
sublime_docblockr_package_custom-1
diff --git a/php.sublime-completions b/php.sublime-completions
index 5a8432b..e6990e0 100644
--- a/php.sublime-completions
+++ b/php.sublime-completions
@@ -2,21 +2,24 @@
"scope": "source.php comment.block.documentation",
"completions":
[
+ { "trigger" : "Drupal", "contents": "Drupal"},
{ "trigger" : "@api", "contents": ""},