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
/* command "Bible" */ | |
CmdUtils.CreateCommand({ | |
name: "bible", | |
icon: "http://www.biblegateway.com/favicon.ico", | |
homepage: "http://www.biblegateway.com/", | |
author: { name: "CodeJoust", email: "http://codejoust.com/contact"}, | |
license: "GPL", | |
description: "Search BibleGateway", | |
help: "BibleGateway: General Search", | |
takes: {"input": noun_arb_text}, |
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 Config{ | |
private static $_data; | |
private static $_instance; | |
public function __construct() { } | |
public static function getInstance(){ |
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
// ==UserScript== | |
// @name Gmail Replace Domain | |
// @author http://codejoust.com | |
// @namespace http://mail.google.com/ | |
// @description example script to alert "Hello world!" on every page | |
// @include http://mail.google.com/* | |
// ==/UserScript== | |
var your_domain = 'yourdomain.com'; //Your domain to change. | |
var canvas_frame = document.getElementById('canvas_frame').contentWindow.document; //The Canvas Frame in Gmail | |
var user_id = canvas_frame.getElementById('guser').getElementsByTagName('b')[0]; //Get the child b element containing username |
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/ruby | |
class Person | |
def initialize(name, email) | |
@name, @email = name, email.gsub('|', '').gsub('*','.') | |
end | |
def show_name | |
@name | |
end | |
def visit(site) | |
if (@data["portfolio"].match(/http:\/\//) && system("firefox #{site}")) |
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"> |
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
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
// 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
#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
import serial, cwiid, time, sys | |
print('Place wiimote in discoverable mode now') | |
wiimote = cwiid.Wiimote() | |
if not wiimote: | |
print('cannot find wiimote') | |
sys.exit() | |
OlderNewer