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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"^m" = { | |
"^m" = { | |
"?" = { | |
"!" = ("insertText:", "\U203D"); /* ‽ */ | |
}; | |
"o" = { | |
"/" = { | |
"\\~" = ("insertText:", "\U266A"); /* ♪ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--[[ | |
ProFi v1.3, by Luke Perkin 2012. MIT Licence http://www.opensource.org/licenses/mit-license.php. | |
Example: | |
ProFi = require 'ProFi' | |
ProFi:start() | |
some_function() | |
another_function() | |
coroutine.resume( some_coroutine ) | |
ProFi:stop() |
Locate the section for your github remote in the .git/config
file. It looks like this:
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = [email protected]:joyent/node.git
Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/*
to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Erik Kastner 2008-02-16 small blog engine with XMLRPC, hAtom and S3 upload (through xlmrpc) support | |
require 'rubygems' | |
require 'sinatra' | |
require 'xmlrpc/marshal' | |
require 'active_record' | |
require 'aws/s3' | |
require 'stringex' | |
ActiveRecord::Base.establish_connection(:adapter => "sqlite3", :database => "sin.db") | |
NANOC_DIR = "/Users/cvannoy/personal/dummied/content/blog" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# $~ and $_ are frame-local, but they're set across frames and you don't know when | |
def foo(a, b) | |
p $~ # => nil | |
a[b] # call to String#[], b is a regexp | |
p $~ # => MatchData | |
end | |
foo("hello", /hel/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def compass_sass_engine_options | |
fail "configuring Compass with 'relative_assets = true' doesn't make much sense in the context of nanoc" if Compass.configuration.relative_assets? | |
options = Compass.sass_engine_options | |
options[:load_paths].each do |x| | |
class << x | |
alias _inspect inspect | |
def inspect | |
_inspect.gsub(/:0x\h+/, '') |
Literals are ugly. Let's remove them.
True/false:
2.0.0p0 :001 > !Date
=> false
2.0.0p0 :002 > require Date.to_s.downcase
=> true
Integers and floats:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while true | |
value = rand > 0.8 ? "\e[031mF\e[0m" : "\e[032m.\e[0m" | |
print value | |
sleep rand / 2 | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# This Rules file is an attempt at a near zero configuration for the common | |
# use cases when creating a simple site with nanoc. It's meant to have | |
# better defaults so new users don't have to configure it much if at all. | |
# For the most part, it copies all files from the content folder to the | |
# output folder with the same name. It has the following features: | |
# | |
# * Certain predefined page extensions such as html, haml, md, markdown and | |
# textile are routed to "clean" URI's (see below regarding Item identifiers). |
OlderNewer