Skip to content

Instantly share code, notes, and snippets.

@dgraversen
dgraversen / x
Created November 11, 2008 08:02
SCN Search
/**
* SCN Search
*/
CmdUtils.CreateCommand({
name: ['scn-search'],
description: "Direct access to SCN search",
homepage: "http://figaf.com/",
author: { name: "Daniel Graversen"},
license: "GPL",
@dgraversen
dgraversen / x
Created November 7, 2008 16:30
PI resources
// -----------------------------------------------------------------
// Direct access to PI resources.
// Searches the Firefox history database for information about PI systems.
// Then opens the selected resourses.
//
//
// inspired from http://www.riaexpert.net/ubiquity-commands-presented-by-digitalghost/
// -----------------------------------------------------------------
// -----------------------------------------------------------------
// Direct access to PI resources.
// Searches the Firefox history database for information about PI systems.
// Then opens the selected resourses.
//
//
// inspired from http://www.riaexpert.net/ubiquity-commands-presented-by-digitalghost/
// -----------------------------------------------------------------
var noun_type_pi_history = {
_name: "pi_history",
suggest: function(text,html){
var suggestions = [];
var historyService = Components.classes["@mozilla.org/browser/nav-history-service;1"].getService(Components.interfaces.nsINavHistoryService);
var options = historyService.getNewQueryOptions();
// first query object searches for "firefox" in title/URL
CmdUtils.CreateCommand({
name: "hello-world",
execute: function() {
fh = fopen("c://setup.txt", 0); // Open the file for reading
if(fh!=-1) // If the file has been successfully opened
{
length = flength(fh); // Get the length of the file
str = fread(fh, length); // Read in the entire file
fclose(fh); // Close the file