Skip to content

Instantly share code, notes, and snippets.

@boyron
boyron / commit.push.build.sh
Last active November 25, 2016 17:27
Commit, push and build at once
#!/bin/bash
# @see http://www.ittybittytalks.com/commit-push-trigger-jenkins-build/
git commit -a -m "$1"
git push
curl --user <your_jenkins_username>:<your_jenkins_API_key> http://<jenkins_server_url>/job/<your_jenkins_job_name>/build
@boyron
boyron / trigger.jenkins.build.sh
Created May 6, 2014 10:31
Trigger jenkins build from command line
# @see http://www.ittybittytalks.com/how-to-automate-your-jenkins-build-script/
curl --user <your_jenkins_username>:<your_jenkins_API_key> http://<jenkins_server_url>/job/<your_jenkins_job_name>/build
@boyron
boyron / jquery.each.break.continue.js
Created May 3, 2014 11:47
jQuery each break and continue
$("#tblId tr").each(function(i, obj) {
if($(obj).attr('id') =='idBreakHere' ){
return false; //this is equivalent of 'break' for jQuery loop
}
}
$("#tblId tr").each(function(i, obj) {
if($(obj).attr('id') =='idToFind' ){
return; //this is equivalent of 'continue' for jQuery loop
@boyron
boyron / cpu.vbs
Created May 3, 2014 11:01
32 or 64 Bit Windows?
'Copyright 2010 - Ron
'http://www.ittybittytalks.com
On Error Resume Next
Set WshShell = WScript.CreateObject("WScript.Shell")
X = WshShell.RegRead("HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\PROCESSOR_ARCHITECTURE")
If X = "x86" Then
drush upwd admin --password="p@ssw0rd"
@boyron
boyron / drupal.views.filter.or.php
Created May 2, 2014 11:18
Drupal views: force contextual filter to use logical OR condition
/**
* @file: MY_MODULE.views.inc
*
* Implementation of hook_views_query_alter().
* @param view $view
* @param views_plugin_query_default $query
*/
function MY_MODULE_views_query_alter(&$view, &$query) {
if ($view->name == 'MY_VIEW') {
$query->where[0]['type'] = 'OR';
@boyron
boyron / drupal.views.filter.merge.php
Last active March 25, 2016 18:55
Drupal views: Merge contextual filter with exposed filters in query.
/**
* @file: MY_MODULE.views.inc
*
* Implementation of hook_views_query_alter().
* 1. Resolves conflict between contextual filter and regular filter (topic id, sub topic).
* Both refer to same database field, so merge them in one 'where' clause instead of two that Views comes up with.
* 2. By default, show all results from a topic and its sub-topics.
* [If a document is tagged with a sub-topic but not its parent topic, it was not shown in the default result.]
* @param view $view
* @param views_plugin_query_default $query
@boyron
boyron / drush.set.theme.sh
Last active August 29, 2015 14:00
Change Drupal theme using DruSh
# get the current default/admin theme
drush status theme
# change!
drush vset theme_default garland
drush vset admin_theme garland