This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Implements hook_theme(). | |
*/ | |
function cogito_theme($existing, $type, $theme, $path) { | |
global $theme; | |
$path_to_child = "/" . drupal_get_path('theme', $theme) . '/'; | |
$path = is_file( getcwd() . $path_to_child . 'header.tpl.php' ) ? $path_to_child : $path; | |
return array( | |
'cogito_header' => array( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env drush php-script --everything -v | |
<?php | |
// --------------------------------------- | |
// CREDENTIALS ETC. | |
// --------------------------------------- | |
$dir = "public_html"; | |
$theme_dir = "public_html/sites/all/themes"; | |
$makefile = "site.make"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <SoftwareSerial.h> | |
void setup() { | |
Serial.begin(57600); | |
} | |
void loop() { | |
if (Serial.available()) { | |
Serial.write(Serial.read()); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <SoftwareSerial.h> | |
#include <TinyGPS.h> | |
/* This sample code demonstrates the normal use of a TinyGPS object. | |
It requires the use of SoftwareSerial, and assumes that you have a | |
4800-baud serial GPS device hooked up on pins 3(rx) and 4(tx). | |
*/ | |
TinyGPS gps; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<VirtualHost *:80> | |
ServerName component.local | |
ServerAlias www.component.local | |
ServerAlias component-something.pagekite.me | |
DocumentRoot /Users/Pigsy/Sites/component/public_html | |
<Directory /Users/Pigsy/Sites/component/public_html/> | |
Options Indexes FollowSymLinks MultiViews | |
AllowOverride All | |
Order allow,deny | |
allow from all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Little helper to show our contexts | |
global $user; | |
if ($user->uid == 1 && $contexts = context_active_contexts() ) { | |
$msg = "Active Contexts: "; | |
foreach ($contexts as $key => $context) { | |
$msg .= "<label class='label round context'>" . $context->name . "</label>"; | |
} | |
drupal_set_message( $msg, 'debug'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$site_addr = "http://". $_SERVER['HTTP_HOST'] . "/cultch"; | |
define('WP_HOME', $site_addr); | |
define('WP_SITEURL', $site_addr); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Cleaning up a problematic submodule | |
# ====================================== | |
# Remove submodule foo data from .git/config | |
# Remove the stale submodule's gitfile rm foo/.git | |
# Remove the stale submodule's repo rm -rf .git/modules/foo | |
# Clean now: git clean -xdf | |
# Fun Git aliases: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function some_plugin_events_get_upcoming_ids() { | |
//We need some helper classes from timely | |
global $post, $ai1ec_calendar_helper, $ai1ec_events_helper; | |
if (!is_object($ai1ec_events_helper)){ | |
return; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function ai1ec_cl_get_upcoming_events( Ai1ec_Registry_Object $registry ) { | |
global $cleventlist; | |
$date_system = $registry->get( 'date.system' ); | |
$search = $registry->get('model.search'); | |
$local_date = $registry | |
->get( 'date.time', $date_system->current_time(), 'sys.default' ); |
OlderNewer