Skip to content

Instantly share code, notes, and snippets.

View modcab's full-sized avatar

Modesto Caballero modcab

  • Modlabs IT Solutions
  • London, UK
View GitHub Profile
@mbadolato
mbadolato / build.xml
Created January 20, 2012 18:34
Jenkins build.xml file for Symfony 2 projects
<?xml version="1.0" encoding="UTF-8"?>
<project name="YOUR_PROJECT_NAME" default="build" basedir=".">
<property name="source" value="src"/>
<property name="ignore" value="build"/>
<target name="clean"
description="Clean up and create artifact directories">
<delete dir="${basedir}/build/api"/>
<delete dir="${basedir}/build/code-browser"/>
/**
* Implements field_group_build_pre_render_alter.
*/
function iniciativas_field_group_build_pre_render_alter(&$element) {
if (!isset($element['#view_mode']) && isset($element['group_edit_datos_basicos'])) {
$element['group_edit_datos_basicos'] += array(
'#states' => array(
'visible' => array(
'#edit-field-iniciativa-tipo-und' => array('value' => 'individual'),
),
@juampynr
juampynr / isset_and_empty.md
Last active December 19, 2015 22:48
PHP isset() and empty() black magic

When dealing with arrays in PHP, checking for an index like if ($a['foo']) throws a PHP warning.

There are two ways to avoid these warnings: one is using isset(), which checks the existance of an array index. The second one is empty(), which not only checks for the existence of the array index, but also that the value that contains is not empty (not NULL, 0, '' or FALSE).

Here are some console examples:

juampy@juampybox $ php -a
php > $a = array('foo' => 'asdfasd');
php &gt; 
@demisx
demisx / angularjs-providers-explained.md
Last active May 17, 2024 03:38
AngularJS Providers: Constant/Value/Service/Factory/Decorator/Provider
Provider Singleton Instantiable Configurable
Constant Yes No No
Value Yes No No
Service Yes No No
Factory Yes Yes No
Decorator Yes No? No
Provider Yes Yes Yes

Constant

@aweijnitz
aweijnitz / Vagrantfile
Last active March 25, 2024 13:54
This is a Vagrant file and a provisioning script to create a Debian-based Jenkins server, including Java, Ant and Tomcat. Also see "provision.sh" below
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# Every Vagrant virtual environment requires a box to build off of.
# Named boxes, like this one, don't need a URL, since the are looked up
anonymous
anonymous / gist:74e212d2cf421d34836154926ee8c615
Created September 14, 2016 18:48
CONNECT 8BITDO ZERO CONTROLLER TO POCKET CHIP AND CONFIGURE PICO-8
<<CONNECT 8BITDO ZERO CONTROLLER TO POCKET CHIP AND CONFIGURE PICO-8>>
info gathered via https://bbs.nextthing.co/t/usb-controller-for-pico-8-on-pocketc-h-i-p/5077/8
just follow the following steps
-=first pair controller using bluetooth=-
1. open terminal on pocketCHIP (or ssh using putty or something else with a regular keyboard)
2. type "bluetoothctl" to enter interactive shell