Skip to content

Instantly share code, notes, and snippets.

wsk query to use on test tool:
(#LL000931M# OR #LL000A21K# OR #LL000A219# OR #LL000931N# OR #LL000A21R# OR #LL000931O# OR #LL000A215# OR #LL00093YA# OR #LL000A216# OR #LL000A21M# OR #LL000931P# OR #LL000931Q# OR #LL000931R# OR #LL000931S# OR #LL000931T# OR #LL0009UFB# OR #LL0009T53#) AND (#JU#ENGL# OR #JU#SCOT# OR #JU#NIRE# OR #JU#WALE#) AND CAW-PUB-DATE(>insert-start-date) AND CAW-PUB-DATE(<insert-end-date)
CSI Numbers:
281949, 281951, 281952, 281953, 281954, 281955, 281959, 281965
.
@soulston
soulston / Diff twig_engine..8.x
Created September 13, 2012 23:48
git diff twig_engine..8.x 14/09/2012
diff --git a/core/includes/form.inc b/core/includes/form.inc
old mode 100755
new mode 100644
index 28b766c..07cce93
--- a/core/includes/form.inc
+++ b/core/includes/form.inc
@@ -2766,6 +2766,40 @@ function form_get_options($element, $key) {
}
/**
@soulston
soulston / gist:3834348
Created October 4, 2012 15:22
Drupal 7 load an image from a field
<?php
$image = field_get_items('node', $node, 'my_field_name')) {
// current is just a quick way to get the first item in the array - you would probably array_pop here or just call
// $image = $image[0];
$image = current($image);
$image_uri = $image['uri'];
// Run the image through image styles.
@soulston
soulston / gist:3835190
Created October 4, 2012 17:39
Views exposed filter labels
/**
* Implements hook_form_alter().
To Replace the -Any- value in filters by it's label text
*/
function theme_form_alter(&$form, &$form_state, $form_id) {
kpr($form);
if ($form['#id'] == 'views-exposed-form-admin-people-block-1') {
// $my_label = 'label name';
foreach($form['#info'] as $key => $filter) {
if (stripos($key, 'filter-field') !== 0) {
@soulston
soulston / gist:3965293
Created October 27, 2012 16:47
Git colours
[color]
ui = auto
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red bold
@soulston
soulston / gist:4067177
Created November 13, 2012 17:32
Generic .gitignore file
###################
# compiled source #
###################
*.com
*.class
*.dll
*.exe
*.pdb
*.dll.config
*.cache
@soulston
soulston / gist:4088080
Created November 16, 2012 15:14 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@soulston
soulston / markdown.xml
Created November 16, 2012 15:31 — forked from lg0/markdown.xml
Markdown Syntax Highlighting for Sublime text 2
<!-- copy this to YOUR_THEME.tmTheme-->
<dict>
<key>name</key>
<string>diff: deleted</string>
<key>scope</key>
<string>markup.deleted</string>
<key>settings</key>
<dict>
<key>background</key>
<string>#EAE3CA</string>
@soulston
soulston / nopremium-1285100.patch
Created November 28, 2012 14:49
nopremium patch
/**
* Implementation of hook_field_extra_fields().
*
* patch http://drupal.org/node/1285100
*/
function nopremium_field_extra_fields() {
$extra = array();
foreach (node_type_get_types() as $type) {
$extra['node'][$type->type] = array(
@soulston
soulston / gist:4224963
Created December 6, 2012 14:49
field_get_items
<?php
$node = node_load($nid);
if ($image = field_get_items('node', $node, 'field_biography_image')) {
// Check the author actually has an image.
$image = current($image);
$image_author = $image['uri'];
$image_alt = check_plain($image['alt']);
$image_title = check_plain($image['title']);
// Run the image through image styles.