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 hidden or 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 bash | |
# Apt-install various things necessary for Ruby etc., | |
# and remove optional things to trim down the machine. | |
apt-get -y update | |
apt-get -y upgrade | |
apt-get -y install linux-headers-$(uname -r) build-essential | |
apt-get -y install zlib1g-dev libssl-dev libreadline-gplv2-dev libyaml-dev | |
apt-get -y install vim | |
apt-get -y install git-core |
This file contains hidden or 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
# | |
# = Capistrano database.yml task | |
# | |
# Provides a couple of tasks for creating the database.yml | |
# configuration file dynamically when deploy:setup is run. | |
# | |
# Category:: Capistrano | |
# Package:: Database | |
# Author:: Simone Carletti <[email protected]> | |
# Copyright:: 2007-2010 The Authors |
This file contains hidden or 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
require 'digest' | |
# Get SHA256 Hash of a file | |
puts Digest::SHA256.hexdigest File.read "data.dat" | |
# Get MD5 Hash of a file | |
puts Digest::MD5.hexdigest File.read "data.dat" | |
# Get MD5 Hash of a string | |
puts Digest::SHA256.hexdigest "Hello World" | |
# Get SHA256 Hash of a string using update |
This file contains hidden or 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
git branch -m old_branch new_branch # Rename branch locally | |
git push origin :old_branch # Delete the old branch | |
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote |
This file contains hidden or 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
# Steps to install and run PostgreSQL 9.4.1 using Homebrew (Mac OS X) | |
# (if you aren't using version 9.3, change line #9 with the correct version) | |
launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist | |
mv /usr/local/var/postgres /usr/local/var/postgres93 | |
brew update | |
brew upgrade postgresql | |
initdb /usr/local/var/postgres -E utf8 | |
pg_upgrade -b /usr/local/Cellar/postgresql/9.3/bin -B /usr/local/Cellar/postgresql/9.4.1/bin -d /usr/local/var/postgres93 -D /usr/local/var/postgres | |
cp /usr/local/Cellar/postgresql/9.4.1/homebrew.mxcl.postgresql.plist ~/Library/LaunchAgents/ |
This file contains hidden or 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 | |
require 'csv' | |
require 'json' | |
if ARGV.size != 2 | |
puts 'Usage: csv_to_json input_file.csv output_file.json' | |
puts 'This script uses the first line of the csv file as the keys for the JSON properties of the objects' | |
exit(1) | |
end |
This file contains hidden or 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
module TestWithCassette | |
# cribbed from Rails and modified for VCR | |
# https://github.com/rails/rails/blob/b451de0d6de4df6bc66b274cec73b919f823d5ae/activesupport/lib/active_support/testing/declarative.rb#L9 | |
def test_with_cassette(name, vcr_options = {}, &block) | |
auto_cassette_name = name.gsub(/\s+/, '_') | |
test_name = "test_#{auto_cassette_name}".to_sym | |
if block_given? | |
group = vcr_options.delete(:group) | |
group_prefix = "#{group}/" if group.present? |
This file contains hidden or 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
# … | |
VCR.configure do |c| | |
c.hook_into :webmock | |
c.cassette_library_dir = 'spec/cassettes' | |
c.default_cassette_options = { :record => :new_episodes } | |
## Ignore some requests based on the hosts involved. | |
c.ignore_hosts 'localhost', '8.8.8.8', 'our.local.test.server.org' |
OlderNewer