Skip to content

Instantly share code, notes, and snippets.

View feed
$.getScript("DOMAIN.COM/rssReader.js", function() {
var rss = new RssReader;
rss.main();
});
Tweet Note/Link
var t = op.getLineText();
var et = encodeURIComponent(t);
var link = op.attributes.getOne("url");
var twt = "https://twitter.com/share?text=" + et + "&url=" + link;
window.open(twt);
function PaperlessWeb(url,title) {
url = url.replace("www.dropbox","dl.dropboxusercontent");
var xmlDoc=loadXMLDoc(url);
var howmanyitems=xmlDoc.getElementsByTagName("itemName");
//var howmanynotes=xmlDoc.getElementsByTagName("itemNote");
var output="<p>";
for (i=0;i<howmanyitems.length;i++) {
//exclude completed items
@jkishner
jkishner / opml bookmarklet
Created January 24, 2014 18:59
opml bookmarklet
javascript:alert('<opml><body><outline text="&lt;a href='+location.href+'&gt;'+document.title+'&lt;/a&gt;"><outline text="'+window.getSelection()+'" icon="quote-left"/></outline></body></opml>');
import re
import string
import console
import urllib
import sys
import clipboard
import webbrowser
console.clear()
indent all
function actionHere () {
var string = op.getLineText();
if (string.charAt(0) == " ") {
op.reorg (right, 1);
var newline = string.substring(1);
op.setLineText(newline);
}
}
var ctheads = 0;
@jkishner
jkishner / split Fargo headline x times
Created November 19, 2013 19:30
This is a simple script for the menubar outline in Fargo.io that will split a headline into multiple sections. Insert a ^ wherever you want the headline split, then run the script. The text before the first ^ will stay on that line. The text after each additional ^ will be added immediately below the previous headline.
split x times
var line = op.getLineText();
var tagArray = line.split("^");
op.setLineText(tagArray[0]);
for (var i=1; i < tagArray.length; i++) {
op.insert (tagArray[i], down);
}
@jkishner
jkishner / split Fargo headline in 2
Created November 19, 2013 15:23
This is a simple script for the menubar outline in Fargo.io that will split a headline in 2. Insert a ^ where you want the headline split, then run the script. The text before the ^ will stay on that line. The text after the ^ will be added immediately below the headline. (To split a headline more than once, visit https://gist.github.com/jkishne…
split into 2
line = op.getLineText();
line1 = line.split('^')[0];
line2 = line.split('^')[1];
op.setLineText(line1);
op.insert (line2, down);
@jkishner
jkishner / remind me
Created November 8, 2013 20:59
Add this script to your menubar.opml outline in Fargo.io. To use, type your reminder in a headline in Fargo. Leave cursor on that headline, choose the script "Remind me." Enter the time in military time (e.g. 15:20 is 3:20pm). This script only works for a reminder on the same day, and only one reminder at a time. It will also only work in one se…
remind me
dialog.ask("When do you want to be reminded?","","use military time e.g. 15:20", function (time) {
reminder = op.getLineText();
dialog.alert("You have asked to be reminded to " + reminder + " at " + time + " today");
var myVar=setInterval(function(){myTimer()},60000);
function myTimer() {
var now = clock.now().toString();
var date = clock.now().toDateString();
var due = date + " " + time + ":00 GMT-0500 (EST)";
if (now > due) { dialog.alert (reminder); clearInterval(myVar); }
@jkishner
jkishner / export Fargo outline as HTML
Last active December 27, 2015 02:09
This script will create an HTML file in dropbox in which the cursor text is the title and all its children are rendered as unordered lists. A new window opens with the shareable Dropbox URL. Adapted from a op.visitSubs script written by Dave Winer.
export as html
var title = op.getLineText();
var s = "";
var head = "<html><body><h1>" + title + "</h1>";
var foot = "</body></html>";
op.visitSubs (
function (headline, level) {
s += string.filledString ("\t", level) + "<li>" + headline.getLineText () + "</li>\r\n";
},
function () {s += "<ul>";},