Skip to content

Instantly share code, notes, and snippets.

View Jermolene's full-sized avatar

Jeremy Ruston Jermolene

View GitHub Profile
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Scrolling Test</title>
<script>
</script>
</head>
<body>
/*\
title: $:/core/modules/widgets/event.js
type: application/javascript
module-type: widget
Event handler widget
\*/
(function(){
@Jermolene
Jermolene / getlist.js
Created October 6, 2016 08:14
Experimental 'getlist' filter operator for TiddlyWiki5 - see https://github.com/Jermolene/TiddlyWiki5/issues/2598
/*\
title: $:/core/modules/filters/getlist.js
type: application/javascript
module-type: filteroperator
Filter operator returning the tiddlers whose titles are listed in the specified list fields of the selected tiddlers
\*/
(function(){
@Jermolene
Jermolene / hack
Created March 13, 2015 11:24
Hack to double line breaks in selected tiddlers
$tw.utils.each($tw.wiki.filterTiddlers($tw.wiki.getTiddlerText("$:/temp/advancedsearch")),function(title) {var tiddler=$tw.wiki.getTiddler(title);$tw.wiki.addTiddler(new $tw.Tiddler(tiddler,{text: tiddler.fields.text.replace(/\n/mg,"\n\n")}))});
@Jermolene
Jermolene / hack
Created March 11, 2015 11:53
Convert .txt tiddlers to wikitext
$tw.wiki.each(function(tiddler,title) {if(title.substr(-4) === ".txt") {$tw.wiki.addTiddler(new $tw.Tiddler(tiddler,{title: title.substr(0,title.length-4), type: "text/vnd.tiddlywiki"}));$tw.wiki.deleteTiddler(title);}});
@Jermolene
Jermolene / hack
Created March 3, 2015 19:13
Word counting hack for TiddlyWiki 5.1.7
var tag="mytag";r="";$tw.wiki.each(function(t){if(t.hasTag(tag)){r=r+" "+(t.fields.text||"")}});r.trim().replace(/\s+/gi," ").split(" ").length
@Jermolene
Jermolene / gist:8383863
Last active April 25, 2023 04:00
Unofficial build of TiddlyWiki 5.0.7-prerelease for testing
<!doctype html>
<!-- The following comment is called a MOTW comment and is necessary for the TiddlyIE Internet Explorer extension -->
<!-- saved from url=(0021)http://tiddlywiki.com -->
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> <!-- Force IE standards mode for Intranet and HTA - should be the first meta -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="application-name" content="TiddlyWiki" />
<meta name="generator" content="TiddlyWiki" />
<meta name="tiddlywiki-version" content="5.0.7-prerelease" />
@Jermolene
Jermolene / gist:8377452
Last active February 7, 2017 18:01
Modified tabs macro for TiddlyWiki5 including link to the tab tiddler.Second version added to work with Firefox
\define tabs(tabsList,default,state:"$:/state/tab")
<div class="tc-tab-buttons"><$list filter="$tabsList$" variable="currentTab"><$button set=<<qualify "$state$">> setTo=<<currentTab>> default="$default$" selectedClass="tc-tab-selected"><$view tiddler=<<currentTab>> field="caption"><$macrocall $name="currentTab" $type="text/plain" $output="text/plain"/></$view> <$link to=<<currentTab>>>&hellip;</$link> </$button>
</$list>
</div>
<div class="tc-tab-divider">
</div>
<div class="tc-tab-content">
<$list filter="$tabsList$" variable="currentTab">
<$reveal type="match" state=<<qualify "$state$">> text=<<currentTab>> default="$default$">
<$transclude tiddler=<<currentTab>>/>
@Jermolene
Jermolene / readme.md
Last active March 14, 2020 03:13
Here's the way to get a twitter follow button into TiddlyWiki (version 5).

The only change from the version published at https://dev.twitter.com/docs/follow-button is that new lines have been removed.

Note that the src URL is given without a protocol (ie "http" or "https"). It's done this way so that it works on sites whether they are hosted on a HTTP or HTTPS domain. If you want the Twitter button to work while using a TiddlyWiki offline on a "file://" URL, then you'll need to manually add the protocol. For example:

<iframe allowtransparency="true" frameborder="0" scrolling="no" src="http://platform.twitter.com/widgets/follow_button.html?screen_name=jermolene"  style="width:300px; height:20px;"></iframe>