Skip to content

Instantly share code, notes, and snippets.

View karlosgliberal's full-sized avatar

karlos g liberal karlosgliberal

View GitHub Profile
<?php
//tiene mas peligro que una escopeta de feria pero yo que se por guardarlo todo como las urracas
global $user;
$type = 'garden';
$node = array('uid' => $user->uid, 'name' => $user->name,
'type' => $type);
module_load_include('inc', 'node', 'node.pages');
$form = drupal_get_form($type .'_node_form', $node);
// sacado de este snipsets y cambiado las
//rutas de osc para que pille
//el programa andorid osc.
import processing.opengl.*;
import oscP5.*;
OscP5 oscP5;
float xrot = 0;
float zrot = 0;
select channel.title, channel.link, channel.item.title, channel.item.link, channel.item.description, channel.item.guid
from xml where url in( 'http://karlosgliberal.investic.net/blog/feed', 'http://miren.investic.net/blog/feed') and channel.item.title like "%post%"
#wget para hacer cron con user agent definido
wget --user-agent="Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6" http://devinvestic.com/cron.php > /dev/null 2>&1
<?
/**
* Implementation of hook_nodeapi().
* Drupal Crear dos nodos con un campo en comun
*/
function sorteo_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
switch ($op) {
case 'insert':
//crear dos nodos de quiz relacionados por su campo de nid
if($node->type == 'quiz' && !$node->field_identificador[0]['value']){
grep "10/Dec/2009:12" access.www | awk '{print $7}'
<?php
/**
* Implementation of hook_views_query_alter().
*/
function modulename_views_query_alter(&$view, &$query) {
if ($view->name == 'viewname') {
$type_clause = FALSE;
// check to see if we already have a node.type clause
foreach ($query->where[0]['clauses'] as $clause) {
if (substr(0, 10, $clause) == 'node.type ') {
<?php if ($submitted): ?>
<span class="submitted"><?php echo format_date($node->created, 'custom', 'd M Y') ?></span>
<?php endif; ?>
@karlosgliberal
karlosgliberal / nodejs-rfid.js
Created June 16, 2011 07:16 — forked from basham/nodejs-rfid.js
Use NodeJS to read RFID ids through the USB serial stream.
/*
DESCRIPTION
-----------
Use NodeJS to read RFID ids through the USB serial stream. Code derived from this forum:
http://groups.google.com/group/nodejs/browse_thread/thread/e2b071b6a70a6eb1/086ec7fcb5036699
CODE REPOSITORY
---------------
https://gist.github.com/806605