Skip to content

Instantly share code, notes, and snippets.

@matthewfl
matthewfl / x
Created November 3, 2008 00:07
Spellcheck for ubiquity
var conf = {
first_find: "spell=1\" class=p>",
last_find: "</a>",
correct: ""
};
CmdUtils.CreateCommand({
name: "spellcheck",
takes: {"Text To check": noun_arb_text},
preview: function(pblock, statusText) {
var text = statusText.text
@matthewfl
matthewfl / ip-get.git
Created January 2, 2009 20:30
Get the IP with Ubiquity
// Ubiquity code from http://ubiquity.appjet.net/
// BY: ip-get
// Title: ip-get
/* Description: Get your Ip address */
CmdUtils.CreateCommand({
name: "ip-get",
preview: function( pblock ) {
jQuery.get("http://json-through.appjet.net/ip", function (ip) {
pblock.innerHTML = "Your ip is "+ip;
@matthewfl
matthewfl / quote.git
Created January 2, 2009 20:33
Get Quote to add to any page from quote.appjet.net
// Quotes from: http://quote.appjet.net
// Ubiquity code from http://ubiquity.appjet.net/
// BY: quote
// Title: quote
/* Description: Add quote to anything from http://quote.appjet.net */
var quote = "Made by Mattewfl.com";
function get_quote (b) {
b = b || function () {};
@matthewfl
matthewfl / TwitterFollowBot.py
Created April 16, 2009 02:31
A twitter Follow bot
# uses http://code.google.com/p/python-twitter/
import twitter
import time
def main():
global uesr, password
twit = twitter.Api(username=user, password= password)
twit.SetCache(None)
while 1:
try:
@matthewfl
matthewfl / x
Created June 7, 2009 02:08
Domainr domain name lookup
function query (domain, obj) {
var url = "http://domai.nr/api/json/search?q="+domain
jQuery.get(url, null, function (j) {
j = Utils.decodeJson(j);
var text = "";
for(var a =0;a< j.results.length;a++) {
text += "<p style='color:";
text += j.results[a].availability == "taken" ? "red" : "green";
text += "'>";
text += j.results[a].domain + j.results[a].path;
@matthewfl
matthewfl / linux vex loader
Created September 27, 2009 07:38
vex linux build file
#!/bin/bash
files=( main ) # should be file name without suffix, suffix should be .c
target="program"
setting="-D_VEX_BOARD"
if [ -z $1 ]
then
echo "$0 [build | download | clean]"
#!/bin/sh -
"exec" "python" "-O" "$0" "$@"
__doc__ = """Tiny HTTP Proxy.
This module implements GET, HEAD, POST, PUT and DELETE methods
on BaseHTTPServer, and behaves as an HTTP proxy. The CONNECT
method is also implemented experimentally, but has not been
tested yet.
// http://www.xs4all.nl/~weegen/eelis/analogliterals.xhtml
#ifndef ANALOGLITERALS_HPP
#define ANALOGLITERALS_HPP
namespace analog_literals {
typedef unsigned int uint;
// Symbols
# make a little code system using a lot of dir
sub makeMess {
my $dep = shift;
if ($dep != 0) {
for(my $c=0; $c<10; $c++) {
mkdir("$c");
chdir("$c");
makeMess($dep-1);
chdir("..");
// the time between bits about 9600 bauds
#define bitDelay 101
void printByte(char out) {
digitalWrite(7, HIGH); // start bit
delayMicroseconds(bitDelay);
for(char mask=0x01; mask; mask <<=1) {
digitalWrite(7, out & mask ? HIGH : LOW); // I am not sure which way this should go
delayMicroseconds(bitDelay);