Skip to content

Instantly share code, notes, and snippets.

View mikeumus's full-sized avatar
🎯
Focusing

Michael Duane Mooring mikeumus

🎯
Focusing
View GitHub Profile
@mikeumus
mikeumus / getCollection(upOne)
Created March 15, 2013 02:09
How to call getCollection() from a doc inside the collection?
<% for document in @getCollection('./blogs').toJSON(): %>
<li typeof="sioc:Page" about="<%= document.url %>" class="<%= 'active' if @document.url is document.url %>">
<a href="<%= document.url %>" property="dc:title"><%= document.title %></a>
</li>
<% end %>
@mikeumus
mikeumus / docpad-feedr-error
Last active December 15, 2015 00:09
docpad-feedr error.
default.html.eco:
<% if tweet in @feedr.feeds.twitter: %>
<li datetime="<%=tweet.created_at%>">
<a href="https://twitter.com/#!/<%=tweet.user.screen_name%>/status/<%=tweet.id_str%>" title="View on Twitter">
<%=tweet.text%>
</a>
</li>
<% end %>
@mikeumus
mikeumus / docpad+fileupload
Created March 22, 2013 16:17
Figuring how to augment DocPad's POST handling to incorporate the fileupload argument.
# The fileupload module uses Express to handle the POST (https://github.com/domharrington/fileupload#usage):
app.post('/upload', fileupload, function(req, res) {}
# DocPad API tells that we can put DocPad atop a existing Express App:
# http://docpad.org/docs/api
# But it'd be nice if we could just do something closer to this:
server.post config.postUrl, fileupload, (req,res,next) ->
@mikeumus
mikeumus / footnotes.plugin.js
Created August 7, 2013 21:29
docs.stardog.com -> footnotes.plugin.js (formerly footnotes.plugin.coffee. Translated via http://js2coffee.org/)
var __hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
module.exports = function(BasePlugin) {
var FootnotesPlugin, cheerio, fs, path, util;
cheerio = require("cheerio");
path = require('path');
fs = require('fs');
util = require('util');
return FootnotesPlugin = (function(_super) {
@mikeumus
mikeumus / nativecomments.plugin.js
Created August 7, 2013 22:21
DocPad NativeComments Plugin translation from coffee to js via js2coffee.org
var __hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
module.exports = function(BasePlugin) {
var NativeCommentsPlugin;
return NativeCommentsPlugin = (function(_super) {
__extends(NativeCommentsPlugin, _super);
function NativeCommentsPlugin() {
@mikeumus
mikeumus / package.fail
Created August 17, 2013 06:34
noflo quickstart guide - package.json - After `npm init` and filling out the questionnaire, `npm install noflo-core --save` resulting in the list of errors.
```
npm ERR! node -v v0.10.7
npm ERR! npm -v 1.2.21
npm ERR! type called_on_non_object
npm ERR! TypeError: Object.keys called on non-object
npm ERR! at Function.keys (native)
npm ERR! at c:\Program Files\nodejs\node_modules\npm\lib\build.js:111:18
npm ERR! at process._tickCallback (node.js:415:13)
npm ERR! If you need help, you may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
@mikeumus
mikeumus / docpad-minicms_route_error
Created September 9, 2013 15:13
Docpad Plugin MiniCMS localhost/9778/cms error
TypeError: Cannot read property 'a' of undefined
at Session.def.get (c:\Users\Michael\Desktop\MDM\Client Projects\SunStarIT.com\Development\Staging\node_modules\docpad-plugin-minicms\out\utils\sessionBridge.js:17:29)
at MinicmsPlugin.module.exports (c:\Users\Michael\Desktop\MDM\Client Projects\SunStarIT.com\Development\Staging\node_modules\docpad-plugin-minicms\out\routes\root.js:16:17)
at callbacks (c:\Users\Michael\Desktop\MDM\Client Projects\SunStarIT.com\Development\Staging\node_modules\docpad\node_modules\express\lib\router\index.js:164:37)
at param (c:\Users\Michael\Desktop\MDM\Client Projects\SunStarIT.com\Development\Staging\node_modules\docpad\node_modules\express\lib\router\index.js:138:11)
at pass (c:\Users\Michael\Desktop\MDM\Client Projects\SunStarIT.com\Development\Staging\node_modules\docpad\node_modules\express\lib\router\index.js:145:5)
at Router._dispatch (c:\Users\Michael\Desktop\MDM\Client Projects\SunStarIT.com\Development\Staging\node_modules\docpad\node_modules\e
@mikeumus
mikeumus / gist:6616504
Created September 18, 2013 22:15
nvm install v0.8.16 attempt on Windows 8 git bash.
Michael@MIKEUMUSSURFACE ~/Desktop/MDM
$ nvm install v0.8.16
grep: invalid option -- o
Usage: grep [OPTION]... PATTERN [FILE]...
Try `grep --help' for more information.
Additional options while compiling:
nvm: install N/A failed!
Michael@MIKEUMUSSURFACE ~/Desktop/MDM
$ nvm install 0.8.16
grep: invalid option -- o
@mikeumus
mikeumus / gist:6626945
Created September 19, 2013 17:34
docpad+prose commands
Rob@ROB-PC ~/Desktop/SunStarIT.com (master)
$ git pull
remote: Counting objects: 466, done.
remote: Compressing objects: 100% (204/204), done.
rRemote: Total 466 (delta 214), reused 458 (delta 210)e
Receiving objects: 92% (429/466)
Receiving objects: 100% (466/466), 132.39 KiB | 0 bytes
Resolving deltas: 100% (214/214), done.
fatal: index-pack failed
@mikeumus
mikeumus / yui-onscroll.js
Created September 21, 2013 07:02
YUI on.scroll header add/remove class snippet.
YUI().use('node', 'event', function (Y) {
function scrolledPast(){
Y.all('#main-header').addClass('main-header-scrolled');
}
function scrolledTop(){
Y.all('#main-header').removeClass('main-header-scrolled');
}