Update: please note that I have since switched to using a set of bash scripts instead of poluting the Git repository with git svn
.
Author: Kaspars Dambis
kaspars.net / @konstruktors
#!/usr/bin/env ruby | |
require 'yaml' | |
require 'pathname' | |
require 'shellwords' | |
module_url_by_path = Dir['**/.gitmodules'].inject({}) do |h, path| | |
IO.read(path).scan(/^\[submodule .*\].*\n((?:\s+.*\n)+)/).flatten.each do |s_attrs| | |
h_attrs = s_attrs.strip.split(/\n/).inject({}) do |h_attrs, s_attr_line| | |
k, v = s_attr_line.strip.split(/\s+=\s+/, 2) | |
h_attrs[k.to_sym] = v |
set :application, 'foo' | |
set :repository, '_site' | |
set :scm, :none | |
set :deploy_via, :copy | |
set :copy_compression, :gzip | |
set :use_sudo, false | |
set :host, '127.0.0.1' | |
role :web, host | |
role :app, host |
from fabric.api import env, run, sudo, local, put | |
def production(): | |
"""Defines production environment""" | |
env.user = "deploy" | |
env.hosts = ['example.com',] | |
env.base_dir = "/var/www" | |
env.app_name = "app" | |
env.domain_name = "app.example.com" | |
env.domain_path = "%(base_dir)s/%(domain_name)s" % { 'base_dir':env.base_dir, 'domain_name':env.domain_name } |
## place this file in the root of your jekyll directory so that it gets copied over to | |
## _site automatically | |
RewriteEngine on | |
RewriteCond %{HTTP:Accept-Encoding} gzip | |
RewriteCond %{REQUEST_FILENAME}.gz -f | |
RewriteRule ^(.*)$ $1.gz [L] |
# Calculate a short checksum of the real hostname to determine a unique color | |
if [[ $TERM =~ "256color" ]]; then | |
host_color="38;5;$((16 + $(hostname | cksum | cut -c1-3) % 256))"; | |
else | |
host_color="1;$((31 + $(hostname | cksum | cut -c1-3) % 6))"; | |
fi |
# | |
# File compressor plugin for jekyll | |
# ================================= | |
# | |
# By [mytharcher](https://github.com/mytharcher) | |
# 2012-05-20 | |
# | |
# Updated by [nicoespeon](https://github.com/nicoespeon) | |
# 2013-04-12 | |
# |
#!/bin/sh | |
### | |
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer) | |
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos | |
### | |
# Alot of these configs have been taken from the various places | |
# on the web, most from here | |
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx |
Update: please note that I have since switched to using a set of bash scripts instead of poluting the Git repository with git svn
.
Author: Kaspars Dambis
kaspars.net / @konstruktors
UI.TextEditor.implement({ | |
cleanHTML: function() { | |
var html = this.textarea.value; | |
// Remove double new lines | |
html = html.replace(/\n\n+/g, "\n"); | |
// Stupid apple-style-spans etc |