Skip to content

Instantly share code, notes, and snippets.

@Hypercubed
Hypercubed / README.md
Last active December 12, 2021 02:23
DocPad: rsync Deploy Script

DocPad: rsync Deploy Script

  • Place deploy.sh in {docpad folder}/bin/
  • Create (or edit) a .env file in your docpad folder with the following values:
#!/bin/bash
DEPLOY_SOURCE_DIR="out/"
DEPLOY_DEST_DIR="~/public_html/"
DEPLOY_SERVER=deploy-server-name
@Hypercubed
Hypercubed / gist:6547962
Created September 13, 2013 08:10
Remove first prefix from filename
for file in *;
do
mv "$file" "${file#*.}"
done
@Hypercubed
Hypercubed / README.md
Last active March 31, 2016 01:43
Drafting and publishing a blog post (in docpad) using [frontman](https://github.com/Hypercubed/frontman)

Drafting and publishing a blog post (in docpad) using frontman

Create a new blog post:

$  frontman new.html.md -t src/templates/draft_post.cson -o .
info:    Writing  [...]\src\drafts\new.html.md
It's saved!

Publishing blog post:

@Hypercubed
Hypercubed / Gruntfile.js
Last active December 7, 2017 20:46
DocPad is great.... but so is Grunt. Use grunt-contrib-connect and grunt-contrib-watch instead of docpad's server and watcher.
'use strict';
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
docpad: {
files: [ "./src/**/*.*" ],
out: ["out"]
},
watch: {
@Hypercubed
Hypercubed / markdown.js
Created December 18, 2013 07:59
Improved angularjs markdown provider/filter/directive
/*
* angular-markdown-directive v0.1.0
* (c) 2013 J. Harshbarger
* License: MIT
*/
/*
Provider usage:
app.config(['markdownProvider', function(markdownProvider) {
/*
* angular-marked-directive v0.0.1
* (c) 2013 J. Harshbarger
* License: MIT
*/
/*
Config:
app.config(['marked', function(marked) {
@Hypercubed
Hypercubed / cite.js
Last active August 29, 2015 13:56
Simple mechanism to link citation references with citation notes.
/* Author: J. Harshbarger
Simple mechanism to link citation references with citation notes. This code will do two things:
1) Highlight a citation note (actually just add the `highlight` class to the parent) when a citation reference or note is clicked.
2) Citation note text (the anchors parent) is added to each citation reference as a popover.
Citation notes and references are linked using standard HTML has linking using the anchor tag. For both the citation note and citation reference the parent of the link is important. For example:
```js
@Hypercubed
Hypercubed / angular-pageslide-directive.css
Created July 15, 2014 01:00
Directive-less ng-pageslide
.ng-pageslide {
z-index: 1000;
position: fixed;
width: 0;
height: 0;
-moz-transition-property: width, height; /* Firefox 4 */
-webkit-transition-property: width, height; /* Safari and Chrome */
-o-transition-property: width, height; /* Opera */
transition-property: width, height;
-webkit-transition-duration: 0.5s; /* Safari */
@Hypercubed
Hypercubed / .gitignore
Last active August 29, 2015 14:10
PowerArray vs....
node_modules/
@Hypercubed
Hypercubed / .gitignore
Last active August 29, 2015 14:10
PowerArray benchmarks
node_modules/