Skip to content

Instantly share code, notes, and snippets.

View cesarmiquel's full-sized avatar

Cesar Miquel cesarmiquel

View GitHub Profile
@sanguis
sanguis / gist:1754684
Created February 6, 2012 20:39
taxonomy_form_options($machine_name) Drupal 7
<?php
/**
* returns a array for use with #options in a form field
* */
function taxonomy_options_array($machine_name, $all = NULL) {
$v = taxonomy_vocabulary_machine_name_load($machine_name);
if (!empty($all)) {
$options[$all[0]] = $all[1];
}
#/usr/bin/env bash
JENKINS_HOME=/var/lib/jenkins
cd $JENKINS_HOME
git add *.xml jobs/*/config.xml users/*/config.xml userContent/*
CHANGES_TO_BE_COMMITTED=$(git status | grep "^# Changes to be committed:" | wc -l)
if [ $CHANGES_TO_BE_COMMITTED -eq 0 ]; then
echo "Nothing to commit"
@sdqali
sdqali / .gitignore
Created February 3, 2012 21:39 — forked from sit/.gitignore
A basic .gitignore file for Hudson configurations
# The following ignores...
# Miscellaneous Hudson litter
*.log
*.tmp
*.old
*.bak
*.jar
*.json
# Linux user files
@pascalduez
pascalduez / demo.module
Created December 24, 2011 15:02
Drupal 7 — Basic Ajax form submit (Ajax framework)
<?php
/**
* @file
* Demo module, Basic Ajax form submit (Ajax framework).
*/
/**
* Implements hook_menu().
*/
@perusio
perusio / gist:1497464
Created December 19, 2011 14:32
How to have an "inline" robots.txt for development/private setups
## Here's the way to have Nginx return a robots.txt file that disallows all crawling by bots.
## This is useful for development and private sites.
location = /robots.txt {
return 200 "User-agent: *\nDisallow: /\n";
}
<?php
/**
* @file
* Tests for clientproject.
*/
class clientProjectFeatureTestCase extends DrupalWebTestCase {
/**
* getInfo() returns properties that are displayed in the test selection form.