Skip to content

Instantly share code, notes, and snippets.

View freshjones's full-sized avatar

William Jones freshjones

View GitHub Profile
@freshjones
freshjones / gist:6d40bc9eb3f64c262646fcd3819d8949
Created December 11, 2019 12:30
Git Log 1 liners for a date range like a month
git log --pretty=format:"%ad: %s" --after="2019-10-31" --until="2019-12-01" --reverse --date=format:'%Y-%m-%d'

Keybase proof

I hereby claim:

  • I am freshjones on github.
  • I am williamjones (https://keybase.io/williamjones) on keybase.
  • I have a public key ASCMRA-xCcSqkU-PwzyHVx5GdoGS5hsHElD24GcLUs7UZAo

To claim this, I am signing this object:

@freshjones
freshjones / gist:8e2e15d1fede9afd0d70
Created November 2, 2015 12:40
Patch for workbench scheduler 7.x-1.7-dev to check for transition state before scheulding
diff --git a/workbench_scheduler.module b/workbench_scheduler.module
index 50a1e19..65f18ba 100644
--- a/workbench_scheduler.module
+++ b/workbench_scheduler.module
@@ -1146,6 +1146,32 @@ function workbench_scheduler_schedules_exist() {
}
/**
+ * Check for the existence of a transition from one state to another.
+ *
@freshjones
freshjones / gist:08d2308d0c360c63dc56
Last active September 10, 2015 15:32
jquery ui range drag
/*
* version 0.0.1
*/
(function( $, undefined ) {
$.widget("ui.dragslider", $.ui.slider, {
options: $.extend({},$.ui.slider.prototype.options,{rangeDrag:false}),
_create: function() {
/* Full Version */
$view->set_display($display_id);
$view->init_handlers();
$view->set_exposed_input($exposed_filters);
$exposed_form_state = array(
'view' => &$view,
'display' => &$view->display[$display_id],
'exposed_form_plugin' => $view->display_handler->get_plugin('exposed_form'),
@freshjones
freshjones / gist:bfc60702fa09db755b7e
Created June 5, 2015 01:51
try catch for entity wrappers
try
{
}
catch(EntityMetadataWrapperException $exc)
{
watchdog(
'MODULE_NAME',
'See ' . __FUNCTION__ . '() <pre>' . $exc->getTraceAsString() . '</pre>',
NULL, WATCHDOG_ERROR
@freshjones
freshjones / gist:e60235983ce421c82eca
Last active August 29, 2015 14:22
Drupal Allow OG Menu Single for Superfish Module
diff --git a/superfish.module b/superfish.module
index f994eaa..d884ed2 100644
--- a/superfish.module
+++ b/superfish.module
@@ -1753,6 +1753,18 @@ function theme_superfish($variables) {
$menu = i18n_menu_localize_tree($menu);
}
+ if(module_exists('og'))
+ {
@freshjones
freshjones / gist:bc8b642e75fa5723582a
Created May 31, 2015 21:16
Mysql Run Secure Installation
sudo mysql_secure_installation
@freshjones
freshjones / gist:cb3606fc468f7cfd1b90
Last active August 29, 2015 14:21
Installing D7 from Drush
mysql -uroot -p -e "CREATE DATABASE mysite"
drush dl drupal-7.x
mv local.mysite.dev
cd local.mysite.dev
drush site-install standard --account-name=admin --account-pass=admin --db-url=mysql://YourMySQLUser:RandomPassword@localhost/mysite
@freshjones
freshjones / gist:8ae24b6f32ee44ea265d
Created April 30, 2015 22:43
save portion of node
<?php
$entity = node_load(33);
echo "on load: {$entity->field_test1[LANGUAGE_NONE][0]['value']}<br/>";
$entity->field_test1[LANGUAGE_NONE][0]['value']='test'.rand(10,100);
echo "before save: {$entity->field_test1[LANGUAGE_NONE][0]['value']}<br/>";
$entity2=new stdClass;
$entity2->nid=$entity->nid;
$entity2->vid=$entity->vid;