Skip to content

Instantly share code, notes, and snippets.

View MattReimer's full-sized avatar
😝
Just about done...

Matt MattReimer

😝
Just about done...
View GitHub Profile
@MattReimer
MattReimer / Asset.php
Created October 4, 2013 21:44
Show contexts DEBUG helper
//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');
<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
#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;
@MattReimer
MattReimer / gist:6323217
Created August 23, 2013 19:43
A quick test of a serial-real GPS device
#include <SoftwareSerial.h>
void setup() {
Serial.begin(57600);
}
void loop() {
if (Serial.available()) {
Serial.write(Serial.read());
}
}
@MattReimer
MattReimer / build.sh
Created October 24, 2012 17:22
Drush install Script
#!/usr/bin/env drush php-script --everything -v
<?php
// ---------------------------------------
// CREDENTIALS ETC.
// ---------------------------------------
$dir = "public_html";
$theme_dir = "public_html/sites/all/themes";
$makefile = "site.make";
/**
* 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(