Example usage:
Layout.helper("modal", function (options) {
return {
bgcolor: options.bgcolor || "#fff",
layout: options.layout || "modalLayout"
};
<?php | |
// saveJSON: XML to JSON conversion/transformation | |
// The saveJSON method is implemented as a method of the example DOMDocumentExtended class, which | |
// extends DOMDocument. It will transform the currently loaded DOM into JSON using XSLT. Since | |
// there isn't a reliable automatic way of detecting if certain siblings nodes should be | |
// represented as arrays or not, a "forceArray" parameter can be passed to the saveJSON method. | |
// It should be noted that the forceArray functionality doesn't recognize namespaces. This is | |
// an easy enough fix, I just didn't need it at the time of writing (look for local-name() and |
<?php | |
// parseInlineVariables takes a multibyte string "stringToParse" and parses for $variable style | |
// variables to swap with the value found in the "variables" associative array. It also supports | |
// better matching with curly braces surrounding the variable, such as {$variable}. Spaces | |
// within the curly braces are OK: { $variable } works too. | |
// Adapt this function to your particular framework (put it in a class, keep it global, etc) | |
function parseInlineVariables( $stringToParse, Array $variables ) | |
{ |
// Meteor extension to allow modifications to documents when publishing. | |
// Also allows specifying an alternate name under which to publish the | |
// collection, using "sub_name". | |
_.extend(Meteor._LivedataSubscription.prototype, { | |
_publishCursor: function (cursor, name) { | |
var self = this; | |
var collection = name || cursor.sub_name || cursor.collection_name; | |
var map_callback = cursor.map_callback || function (obj) { return obj; }; |
<template name="stuff"> | |
<button name="show">Show {{newThingsCount}} new things</button> | |
<ul> | |
{{#each things}} | |
<li>{{title}}</li> | |
{{/each}} | |
</ul> | |
</template> |
Create this folder: | |
/wp-content/plugins/job-manager-private-uploads/ | |
Put the two PHP files in there, then activate this plugin via the WordPress admin. | |
NOTE: your WordPress installation should be configured to allow WP_Rewrite to make modifications to the .htaccess file. |
MOVED: https://github.com/matb33/meteor-collection-hooks |
MOVED: https://github.com/matb33/meteor-ec2-install |
ServerTime = (function () { | |
var sync = new Meteor.SyncObject("serverTime"); | |
var intervalId; | |
function updateTime() { | |
sync.set({ms: Date.now()}); | |
} | |
function updateInterval(intervalMs) { |
AWS = (function () { | |
var SDK = Npm.require("aws-sdk"); | |
var crypto = Npm.require("crypto"); | |
var url = Npm.require("url"); | |
function getAuthenticatedURL(fullUrl, accessKeyID, secretAccessKey, expires) { | |
/* | |
Signature = URL-Encode( Base64( HMAC-SHA1( YourSecretAccessKeyID, UTF-8-Encoding-Of( StringToSign ) ) ) ); |