This file contains hidden or 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
import pickle, pprint, time, os | |
import httplib | |
import smtplib | |
def emailAlert(alert,subject='You have an alert'): | |
fromaddr = "[email protected]" | |
toaddrs = "[email protected]" | |
# Add the From: and To: headers at the start! |
This file contains hidden or 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 | |
/** | |
* Convert a comma separated file into an associated array. | |
* The first row should contain the array keys. | |
* | |
* Example: | |
* | |
* @param string $filename Path to the CSV file | |
* @param string $delimiter The separator used in the file | |
* @return array |
This file contains hidden or 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
<div class="nav prevnext"> | |
<? if($page->hasPrevVisible()): ?> | |
<a class="prev" href="<?= $page->prevVisible()->url() ?>">‹ previous article (<?php echo html($page->prevVisible()->title()) ?>)</a> | |
<? endif ?> | |
<? if($page->hasNextVisible()): ?> | |
<a class="next" href="<?= $page->nextVisible()->url() ?>">next article › (<?php echo html($page->nextVisible()->title()) ?>)</a> | |
<? endif ?> |
This file contains hidden or 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
#! /bin/bash | |
# Originally posted to http://www.raspberrypi.org/phpBB3/viewtopic.php?f=29&t=14255 | |
# This script is used to check a pin at half second intervals and | |
# will shutdown the system if the pin is at a low level. | |
# Portions of this script adapted from "GPIO Driving Example (Shell script)" | |
# found on elinux.org . |
This file contains hidden or 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 | |
#Pages have these fields, they can have comma separated values for group, category and option | |
# Title: Event1 | |
# ---- | |
# Group: Group1 | |
# ---- | |
# Category: Cat2 | |
# ---- | |
# Option: Option1 |
This file contains hidden or 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
# ------------------------------------------------------------------------------ | |
# | |
# Curtousy of the Magento Support Center | |
# http://magentosupport.help/what-are-expires-headers-and-how-do-i-implement-them/ | |
# | |
# ------------------------------------------------------------------------------ | |
# ------------------------------------------------------------------------------ | |
# | Mod Caching via Apache | |
This file contains hidden or 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
#! /bin/sh | |
# Usage 1: | |
# optimize-images.sh /images/dir | |
# | |
# Usage 2: | |
# cd /images/dir | |
# optimize-images.sh | |
EXTENSIONS="jpe?g" |
This file contains hidden or 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/python | |
##################### | |
# GPS-TIME-SYNC # | |
# 2013 flazer # | |
# [email protected] # | |
##################### | |
# Connects to your GPS-Dongle and synchronize systemtime with GPS-UTC-time. | |
# Handles local-timezones |
This file contains hidden or 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 $zeiten = page('oeffnungszeiten') ?> | |
<?php if($zeiten->status() == 'normal'): ?> | |
<!-- hier werden die öffnungszeiten abhängig vom tag angezeigt --> | |
<?php else if($zeiten->status() == 'open'): ?> | |
<!-- hier wird einfach nur angezeigt dass geöffnet ist --> | |
<?php else: ?> | |
<!-- hier wird angezeigt dass geschlossen ist --> | |
<?php endif ?> |
This file contains hidden or 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
local bor, band, bnot = bit.bor, bit.band, bit.bnot | |
local function write4bits(self, bits, char_mode) | |
tmr.delay(1000) | |
gpio.write(self.pin_rs, char_mode and gpio.HIGH or gpio.LOW) | |
for n = 1, 2 do | |
for i, pin in ipairs(self.pin_db) do | |
local j = (2-n)*4 + (i-1) | |
local val = (bit.isset(bits, j)) |
OlderNewer