This is a plugin meant for Jekyll.
Example use:
Easily embed a YouTube video. Just drop this file in your _plugins
directory.
{% youtube oHg5SJYRHA0 %}
# config/initializers/markdown_handler.rb | |
module MarkdownHandler | |
def self.erb | |
@erb ||= ActionView::Template.registered_template_handler(:erb) | |
end | |
def self.call(template) | |
compiled_source = erb.call(template) | |
"Kramdown::Document.new(begin;#{compiled_source};end, auto_ids: false).to_html" |
➜ sample_app git:(sign-up) ✗ rails c | |
Loading development environment (Rails 3.2.6) | |
irb(main):001:0> require "capybara/rails" | |
=> true | |
irb(main):002:0> include Capybara::DSL | |
=> Object | |
irb(main):003:0> include Rails.application.routes.url_helpers | |
=> Object | |
irb(main):005:0> visit signup_path | |
=> nil |
#!/bin/bash | |
echo "Generating an SSL private key to sign your certificate..." | |
openssl genrsa -des3 -out myssl.key 1024 | |
echo "Generating a Certificate Signing Request..." | |
openssl req -new -key myssl.key -out myssl.csr | |
echo "Removing passphrase from key (for nginx)..." | |
cp myssl.key myssl.key.org | |
openssl rsa -in myssl.key.org -out myssl.key |
<!doctype html> | |
<!-- http://taylor.fausak.me/2015/01/27/ios-8-web-apps/ --> | |
<html> | |
<head> | |
<title>iOS 8 web app</title> | |
<!-- CONFIGURATION --> |
AddEncoding gzip .gz | |
RewriteEngine on | |
RewriteCond %{HTTP:Accept-encoding} gzip | |
RewriteCond %{HTTP_USER_AGENT} !Konqueror | |
RewriteCond %{REQUEST_FILENAME}.gz -f | |
RewriteRule ^(.*)\.css$ $1.css.gz [QSA,L] | |
RewriteRule ^(.*)\.js$ $1.js.gz [QSA,L] | |
RewriteRule ^(.*)\.html$ $1.html.gz [QSA,L] |
# Replace any brackets with real values | |
# Try to ssh in to DREAMHOST (ensure it no longer asks for a PW); you may want to restart Terminal | |
ssh [user]@[host] | |
cd ~ | |
mkdir [mydomain_com].git | |
cd [mydomain_com].git | |
git init --bare | |
vi hooks/post-receive | |
# Enter the code from the "post-receive" file (in this gist); save + quit |
# Add these methods to your ApplicationController. Then, any controller | |
# that inherits from it will have these methods and can programmatically | |
# determine what filters it has set. | |
class ApplicationController < ActionController::Base | |
def self.filters(kind = nil) | |
all_filters = _process_action_callbacks | |
all_filters = all_filters.select{|f| f.kind == kind} if kind | |
all_filters.map(&:filter) | |
end |
This is a plugin meant for Jekyll.
Example use:
Easily embed a YouTube video. Just drop this file in your _plugins
directory.
{% youtube oHg5SJYRHA0 %}
require 'formula' | |
# This duplicates the system "screen", but fixes the ability | |
# to use vertical splits. | |
class Screen < Formula | |
url 'http://ftpmirror.gnu.org/screen/screen-4.0.3.tar.gz' | |
homepage 'http://www.gnu.org/software/screen' | |
md5 '8506fd205028a96c741e4037de6e3c42' | |
version '4.00.03' |
module Jekyll | |
require 'slim' | |
Slim::Engine.set_default_options :pretty => true | |
class SlimConverter < Converter | |
safe true | |
priority :low | |
def matches(ext) | |
ext =~ /slim/i |