Skip to content

Instantly share code, notes, and snippets.

<tr class="<<view direction>>"><td><span class="call-title"><$view field="title"/> (<$view field="duration"/>m)</span></td><td><$list filter=[is[current]tags[]] template="$:/themes/pio-theme/TagTemplate" storyview="pop" itemClass="tw-tag-list-item"/></td></tr>
or
<tr class="<$view field='direction'/>"><td><span class="call-title"><$view field="title"/> (<$view field="duration"/>m)</span></td><td><$list filter=[is[current]tags[]] template="$:/themes/pio-theme/TagTemplate" storyview="pop" itemClass="tw-tag-list-item"/></td></tr>
@jayfresh
jayfresh / gist:f8e61419c3c56e1a7448
Created September 4, 2014 18:31
modal widgets - how to close them
/*
This is a paraphrased version of some code I'm working on.
What I'm trying to achieve is:
- open a modal with a custom footer (see 'footer' property of the addTiddler call)
- the footer contains a $button widget with a custom message
- listen for the custom message on $tw.rootWidget and update localstorage to note the button has been clicked
- then close the modal and show another div
I've got as far as the last step. The event handler on $tw.rootWidget doesn't give me any
@jayfresh
jayfresh / gist:22ec848f7aa90aaf461f
Created October 27, 2014 12:40
acceptance tests
Acceptance tests - 12715 ms
Organisations and their properties - 74 ms
Organisations have access to only their own properties - 74 ms
Inviting Users to Organisations - 176 ms
should send them a token in an email - 73 ms
should send long, non-guessable tokens - 46 ms
following the token link and setting up an account should put the User in the Organisation - 57 ms
<strong>T: 020 7655 4820</strong>
<a href="http://sweetspot.com/"><strong>sweetspot.com</strong></a>
<a href="https://www.facebook.com/sweetspothomes?fref=ts"><strong>Facebook/sweetpothomes</strong></a>
<a href="http://www.twitter.com/sweetspothomes"><strong>@sweetspothomes</strong></a>
<a href="http://www.pinterest.com/sweetspothome/"><strong>Pinterest</strong></a>
Image service - S3 client acess - 1652 ms
should allow access to uploaded files by the app - 1041 ms
should not allow web access to uploaded files - 392 ms
should not allow an unauthorised user to access the bucket - 218 ms
Image service - upload limit - 972 ms
should reject uploads if they are over 2MB - 652 ms
should allow uploads if they are under 2MB - 320 ms
#uploadFileForPublicAccess - 341 ms
@jayfresh
jayfresh / gist:fe8416ddce15b2c5038b
Last active August 29, 2015 14:23
hbs-utils using vinyl-fs for the watch method
// based on https://github.com/dpolivy/hbs-utils/blob/master/lib/hbs-utils.js
// modified to use vinyl-fs to watch files so it works with docker-mounted Windows volumes (possibly NFS)
var fs = require('fs'),
path = require('path'),
walk = require('../../node_modules/hbs-utils/node_modules/walk').walk,
watch = require('vinyl-fs').watch; // instead of node-watch
// Precompile a partial
var precompilePartialHelper = function(handlebars, partial) {
[submodule "wireit"]
path = wireit
url = git://github.com/neyric/wireit.git
# in userbag.py:
def tiddler_get(self, tiddler):
store = self.main_store
username = tiddler.title
user = User(username)
user = store.get(user)
userTiddler = Tiddler(username)
userTiddler.bag = self.environ['tiddlyweb.config']['userbag_bag']
userTiddler = store.get(userTiddler)
system.use("com.joyent.Sammy");
POST('/eval', function() {
/* get q like this because request.body doesn't correctly collect parameters with '+' characters - they get converted to ' ' */
var q = decodeURIComponent(this.request.content.split('=')[1].replace(/\+/g," "));
var func;
eval('func = function() { '+q+'};');
var res = func();
if(!res) {
res = "no return value";
diff --git a/socket.io.js b/socket.io.js
index dfd777a..6185082 100644
--- a/socket.io.js
+++ b/socket.io.js
@@ -329,6 +329,12 @@ if (typeof window != 'undefined') this.io.setPath('/socket.io/');
XHR.prototype._request = function(url, method, multipart){
var req = request(this.base._isXDomain());
if (multipart) req.multipart = true;
+
+ // JRL: adding this to enable cross-browser XHR in FF