Skip to content

Instantly share code, notes, and snippets.

@pbuyle
pbuyle / monitor.php
Last active August 29, 2015 14:04
Simple Drupal monitor script (avoid full bootstrap, check DB and cache availability)
<?php
// OH HAI THARE
// NO CACH PLZ
header( "Cache-Control: no-cache, max-age=0, must-revalidate");
// SET ERROR HANDLR
set_error_handler('monitor_handle_error');
// CAN HAS DRUPAL BOOTSTRAP?
define('DRUPAL_ROOT', __DIR__);
chdir(DRUPAL_ROOT);
require_once 'includes/bootstrap.inc';
@pbuyle
pbuyle / affirmation
Created April 23, 2015 15:11
MuleSoft Contributor Agreement Acceptance by Pierre Buyle
I, Pierre Buyle, have read and do accept the MuleSoft Contributor Agreement
at http://www.mulesoft.org/legal/contributor-agreement.html
Accepted on Thu Apr 23 2015 11:11:29 GMT-0400 (EDT)
CmdUtils.CreateCommand({
name: "tux-say",
icon: "http://tuxisalive.com/favicon.ico",
homepage: "http://www.tuxisalive.com/tux-droid-forum/scripts/673765359",
author: { name: "mongolito404", email: "mongolito404@gmail.com"},
license: "GPL",
description: "Read a text with your Tux Droid.",
help: "tux-say Hello World",
takes: {"input": noun_arb_text},
execute: function(msg) {
from tuxisalive.api import *
def start_spin(*args):
key = args[0]
if(key == K_LEFT):
tux.spinning.leftOnAsync(1.0, SPV_SLOW)
else:
tux.spinning.rightOnAsync(1.0, SPV_SLOW)
tux = TuxAPI('127.0.0.1', 270)
@pbuyle
pbuyle / gist:42700
Created January 2, 2009 21:17
Simple script to control VLC (or any MPRIS media player) with the Tux Droid's remote control (http://www.kysoh.com/tux-droid)
#!/usr/bin/python
# -*- coding: UTF8 -*-
import dbus
from tuxisalive.api.TuxAPIConst import *
from tuxisalive.api.TuxAPI import TuxAPI
__author__ = 'mongolito404@gmail.com'
__appname__ = 'TuxVlcControl'
__version__ = '0.0.1'
__date__ = '2008/12/29'
@pbuyle
pbuyle / tuxgtk.py
Created January 3, 2009 21:06
Using the GTK loop to block a Tux Droid script until the K_STANDBY button is pressed (with a bonus status icon)
#! /usr/bin/python
from tuxisalive.api.TuxAPI import *
import gtk
tux = TuxAPI('127.0.0.1', 270)
tux.server.autoConnect(CLIENT_LEVEL_RESTRICTED, 'TuxGTK', 'NONE')
tux.server.waitConnected(10.0)
tux.dongle.waitConnected(10.0)
tux.radio.waitConnected(10.0)
if tux.access.waitAcquire(10.0, ACCESS_PRIORITY_NORMAL):
@pbuyle
pbuyle / gstTest.py
Created January 5, 2009 20:49
Play an audio file on a TuxDroid with GStreamer
#! /usr/bin/python
from tuxisalive.api.TuxAPI import *
import pygst
pygst.require("0.10")
import gst
import gtk
__author__="pbuyle"
__date__ ="$05-janv.-2009 21:21:57$"
<?php
/**
* Implements hook_field_info().
*/
function MODULE_field_info() {
return array(
'video_thumbnail_settings' => array(
'label' => t('Video Thumbnail Settings'),
'description' => t('Configure Video Thumbnail display.'),
'settings' => array(),
@pbuyle
pbuyle / fun_with.module
Created October 15, 2012 17:56
Fun with entity_view
function fun_with_entity_view($entity, $entity_type, $view_mode, $langcode) {
list($entity_id) = entity_extract_ids($entity_type, $entity);
if ($view_mode === 'full') {
$entity->content['teaser'] = entity_view(entity_load($entity_type, $entity_id), $entity_type, 'teaser', $langcode);
}
}
@pbuyle
pbuyle / authorized_key
Last active December 28, 2015 08:29
Drush only SSH access using a dedicated key.
command="/etc/drush/drush-shell" ssh-rsa AAAA...== drush