Skip to content

Instantly share code, notes, and snippets.

William Jones freshjones

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

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 Nov 2, 2015
Patch for workbench scheduler 7.x-1.7-dev to check for transition state before scheulding
View gist:8e2e15d1fede9afd0d70
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.
+ *
View gist:08d2308d0c360c63dc56
/*
* version 0.0.1
*/
(function( $, undefined ) {
$.widget("ui.dragslider", $.ui.slider, {
options: $.extend({},$.ui.slider.prototype.options,{rangeDrag:false}),
_create: function() {
View gist:9d1ab1fdc88a4d1a84e8
/* 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 Jun 5, 2015
try catch for entity wrappers
View gist:bfc60702fa09db755b7e
try
{
}
catch(EntityMetadataWrapperException $exc)
{
watchdog(
'MODULE_NAME',
'See ' . __FUNCTION__ . '() <pre>' . $exc->getTraceAsString() . '</pre>',
NULL, WATCHDOG_ERROR
@freshjones
freshjones / gist:e60235983ce421c82eca
Last active Aug 29, 2015
Drupal Allow OG Menu Single for Superfish Module
View gist:e60235983ce421c82eca
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
Mysql Run Secure Installation
View gist:bc8b642e75fa5723582a
sudo mysql_secure_installation
@freshjones
freshjones / gist:cb3606fc468f7cfd1b90
Last active Aug 29, 2015
Installing D7 from Drush
View gist:cb3606fc468f7cfd1b90
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
View gist:8ae24b6f32ee44ea265d
<?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;
You can’t perform that action at this time.