NOTE I now use the conventions detailed in the SUIT framework
Used to provide structural templates.
Pattern
t-template-name
NOTE I now use the conventions detailed in the SUIT framework
Used to provide structural templates.
Pattern
t-template-name
Backstory: I decided to crowdsource static site generator recommendations, so the following are actual real world suggested-to-me results. I then took those and sorted them by language/server and, just for a decent relative metric, their Github Watcher count. If you want a heap of other projects (including other languages like Haskell and Python) Nanoc has the mother of all site generator lists. If you recommend another one, by all means add a comment.
#import <Foundation/Foundation.h> | |
// clang -g -fobjc-arc -Wall -framework Foundation -o unsafe unsafe.m | |
@interface NSThing : NSObject | |
@end | |
@implementation NSThing | |
- (void) dealloc { |
'use strict'; | |
/* | |
# Javascript Prototyping Best Practices | |
* To create a class, create a constructor function with a `Name` and assign | |
it to a variable of the same `Name`. | |
* In this constructor only define properties using `this.prop` notation |
function addSlashes( str ) { | |
return (str+'').replace(/([\\"'])/g, "\\$1").replace(/\0/g, "\\0"); | |
} | |
var spawn = require('child_process').spawn; | |
var growl = require('growl'); | |
var coffee = './node_modules/.bin/coffee'; | |
var coffee_tasks = []; | |
var handlebars_tasks = []; | |
coffee_tasks.push(spawn(coffee, ['-cwo', 'static/js', 'static/coffee'])); | |
coffee_tasks.push(spawn(coffee, ['-cwo', 'test', 'test/src'])); |
#!/usr/bin/env bash | |
# checks if branch has something pending | |
function parse_git_dirty() { | |
git diff --quiet --ignore-submodules HEAD 2>/dev/null; [ $? -eq 1 ] && echo "*" | |
} | |
# gets the current git branch | |
function parse_git_branch() { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/\1$(parse_git_dirty)/" |
When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:
const Article = require('../../../../app/models/article');
Those suck for maintenance and they're ugly.
""" | |
Free to use under the MIT license | |
Builds a static site from a list of Markdown source files. The source | |
files should have the same directory structure as the desired output. | |
Files are rendered using Markdown2 and can declare metadata variables: | |
--- |
dnsDomainIs = function (h, d) { | |
return h.indexOf(d, h.length - d.length) !== -1 && (d.length === h.length || h.indexOf("." + d, h.length - ("." + d).length) !== -1) | |
} | |
function FindProxyForURL(u, h) { | |
h = h.toLowerCase(); | |
if (h === "appdownload.itunes.apple.com" || dnsDomainIs(h, "battlenet.com.cn") || dnsDomainIs(h, "dist.blizzard.com.edgesuite.net") || /us-ore-\d+\.s3\.amazonaws\.com/.test(h) || /\w{2}-\w{3}-\d{5}\.s3\.amazonaws\.com/.test(h)) { | |
return "DIRECT" | |
} | |
a = []; // user ignore list |