Skip to content

Instantly share code, notes, and snippets.

@boyron
boyron / commit.push.build.sh
Last active Nov 25, 2016
Commit, push and build at once
View commit.push.build.sh
#!/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
Trigger jenkins build from command line
View trigger.jenkins.build.sh
# @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
jQuery each break and continue
View jquery.each.break.continue.js
$("#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
32 or 64 Bit Windows?
View cpu.vbs
'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
@boyron
boyron / drupal.views.filter.or.php
Created May 2, 2014
Drupal views: force contextual filter to use logical OR condition
View drupal.views.filter.or.php
/**
* @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 Mar 25, 2016
Drupal views: Merge contextual filter with exposed filters in query.
View drupal.views.filter.merge.php
/**
* @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 Aug 29, 2015
Change Drupal theme using DruSh
View drush.set.theme.sh
# get the current default/admin theme
drush status theme
# change!
drush vset theme_default garland
drush vset admin_theme garland