Skip to content

Instantly share code, notes, and snippets.

View baisong's full-sized avatar

Oren Robinson baisong

View GitHub Profile
@baisong
baisong / resume.html
Created June 26, 2012 21:01
very old resume HTML file to update...
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=us-ascii" http-equiv="Content-Type" />
<title>(HTML) Computer Resume</title>
<style type="text/css">
h1, h2, h3, ul {margin: 0px; }
h1 {margin-left: 10px; }
p, li, h3, h1 small {font-size:12px;}
p {margin: 6px 0px;}
h2 { color: gray }
@baisong
baisong / _custom_attributes_add_class.php
Created June 29, 2012 15:44
A little helper function for Drupal 6 form manipulation
<?php
/**
* Adds a class to a form element.
*/
function _custom_attributes_add_class($element, $class) {
if ((!is_array($element)) || ((int)strlen($class) === (int)0)) return $element;
if (isset($element['#attributes'])) {
if (!is_array($element['#attributes'])) return $element;
@baisong
baisong / today.txt
Created August 7, 2012 13:03
a modified translation of a dalai lama quote.
today i live,
today i grow.
i will use my energies
to develop myself,
to expand my heart out to others;
to achieve enlightenment for the benefit of all beings.
i will think kind thoughts towards others,
i will be generous, humble and unassuming towards others.
<?php
foreach ( $features as $name => $feature ) {
$info = $feature->info['features'];
foreach ($info['node'] as $nodetype) {
if ($ret_all || (isset($site_features[$name]) && in_array($site_features[$name], $privacy))) {
$bundles[$nodetype] = $feature->info['name'];
}
}
<?php
$template_path = drupal_path('module', 'os_profiles') . '/node--profile.tpl.php';
if (file_exists($template_path)) {
include_once($template_path))
}
else {
include_once($default_node_path);
}
@baisong
baisong / _os_node_query.php
Created September 11, 2012 19:55
attempt to create EntityFieldQuery accounting for vsite
<?php
/**
* Returns a new EntityFieldQuery in the current space, if vsite is enabled.
*/
function _os_node_query($type = '') {
// Prepares a new EntityFieldQuery for nodes.
$query = new EntityFieldQuery();
$query->entityCondition('entity_type', 'node');
@baisong
baisong / bio_box_fail.php
Created September 13, 2012 18:04
What is wrong with this boxes implementation?
// From os_biocv.module
/**
* Implements hook_os_widget().
*
* Exposes blocks as OpenScholar widgets.
*/
function os_biocv_os_widget() {
$items = array();
@baisong
baisong / OSNodeFieldQuery.php
Created September 17, 2012 13:21
A class to extend EntityFieldQuery for common OS conditions.
<?php
// $Id$
/**
* @file
* Common functions for working with node content in OpenScholar.
*/
/**
@baisong
baisong / gkplus_remaining.php
Created October 3, 2012 13:54
Code from iqss_gking.module whose functionality remains to be ported to D7
<?php
// $Id$
/**
* Impements hook_menu().
*
* @ingroup updatefile
* @ingroup biblioterm
*/
function iqss_gking_menu() {
<?php
/**
* useful
*/
function spoodermoon($puuunnndd, $asyousay, $boolean = 'boolean') {
if ($boolean === 'boolean')
$harrible = 'FALSE';
if ($puuunnndd) {
$harrible = 'TRUE';