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 | |
class Director { public function set_dev_servers($arg){} }; | |
class SSViewer { public function set_theme($arg){} }; | |
include_once('../public_html/mpt/_config.php'); | |
$sql = "DELETE FROM SiteTree_versions | |
WHERE CONCAT_WS('_', RecordID, Version) NOT IN |
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
// in c | |
#include <stdio.h> | |
void loopz(int num){ | |
num += 1; | |
if (num < 10) { | |
loopz(num); | |
puts("Cannot Compute"); | |
} else { | |
puts("Stopping"); | |
} |
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
var stylus = require('stylus'), | |
jade = require('jade'), | |
fs = require('fs'); | |
function compile_jade(){ | |
console.log('compiling html index'); | |
var fn = jade.compile(fs.readFileSync('index.jade', 'utf8'), {pretty: true}); | |
if (fn){ | |
fs.writeFileSync('index.html', fn()); | |
} else { |
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
# encoding: utf-8 | |
#require 'rubygems' | |
#require 'fraction' | |
class Base3D | |
attr_accessor :x, :y, :z | |
def initialize(x, y, z) | |
@x = x; @y = y; @z = z | |
end |
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 serial, cwiid, time, sys | |
print('Place wiimote in discoverable mode now') | |
wiimote = cwiid.Wiimote() | |
if not wiimote: | |
print('cannot find wiimote') | |
sys.exit() | |
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
#include <Servo.h> | |
Servo drive1; | |
Servo drive2; | |
void setup(){ | |
Serial.begin(9600); | |
drive1.attach(5); | |
drive2.attach(6); | |
} |
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
// Arduino Char -> Number over serial. For testing, etc. | |
// @author Iain Nash iain.in | |
// @date 12/13/11 | |
//#define PWM_DEMO 1 | |
// ^ uncomment for pwm demo | |
#define PWM_DEMO 0 | |
// ^ and comment this | |
int get_serial_num(){ |
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 MySQLdb, re | |
conn = MySQLdb.connect(host = "localhost", user = "testuser", passwd = "testpass", db = "test") | |
cursor = db.cursor() | |
datafile = open('taxes.txt') | |
line = '' | |
while(line = datafile.readline()): | |
fields = re.split(r'\|+', line) |
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
module.exports = function(opts){ | |
return function(req, res, next){ | |
if ('callback' in req.query){ | |
var callback = req.query.callback.replace(/[^A-Z0-9\.a-z_\$]/g, ''); | |
if (callback.length == 0){ | |
res.setHeader('X-Callback', 'Invalid'); | |
next(); | |
return; | |
} | |
var origHead = res.writeHead, |
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 | |
/** | |
* The Template for displaying all single product posts. | |
*/ | |
?> | |
<?php get_header(); ?> | |
<div id="content"> | |
<div class="wrap"> | |
<div id="leftcol"> |