Skip to content

Instantly share code, notes, and snippets.

View kdwinter's full-sized avatar

Kenneth De Winter kdwinter

  • Ghent, Belgium
  • 07:35 (UTC +02:00)
View GitHub Profile
@kdwinter
kdwinter / Arch-ZFSRoot-on-dm-crypt-UEFI.md
Last active July 24, 2023 21:31 — forked from aaronlauterer/Arch-ZFSRoot-on-dm-crypt-UEFI
ZFSRoot installation over a dm-crypt volume for Arch Linux (UEFI)

Install Arch Linux on root ZFS filesystem

Pre-installation

Download Arch linux

https://archlinux.org

Create bootable USB (don't add partition number!)

# include this in application controller
module Authentication
protected
# Inclusion hook to make #current_user and #signed_in?
# available as ActionView helper methods.
def self.included(base)
base.send :helper_method, :current_user, :signed_in?, :authorized? if base.respond_to? :helper_method
end
# Returns true or false if the user is signed in.
development: &global_settings
database: textual_development
host: 127.0.0.1
port: 27017
test:
database: textual_test
<<: *global_settings
production:
@kdwinter
kdwinter / partials.rb
Created December 20, 2009 10:50 — forked from lenary/partials.rb
# stolen from http://github.com/cschneid/irclogger/blob/master/lib/partials.rb
# and made a lot more robust by me
# this implementation uses erb by default. if you want to use any other template mechanism
# then replace `erb` on line 13 and line 17 with `haml` or whatever
module Sinatra::Partials
def partial(template, *args)
template_array = template.to_s.split('/')
template = template_array[0..-2].join('/') + "/_#{template_array[-1]}"
options = args.last.is_a?(Hash) ? args.pop : {}
options.merge!(:layout => false)
@kdwinter
kdwinter / sunburst.vim
Created December 18, 2009 10:30 — forked from roman/sunburst.vim
" Vim color file
" Maintainer: Roman Gonzalez <romanandnreg at gmail dot com>
" Last Change: 2009 Aug 11
" Version: 0.0.1
" Screenshot: http://img.skitch.com/20090811-ti4b27qbftjybmau32ruygjjwx.jpg
" URL: http://blog.romanandreg.com
" For now this will only work on gvim
set background=dark
@kdwinter
kdwinter / gist:258191
Created December 16, 2009 21:22 — forked from peterc/gist:40246
# NAME: authinabox
# VERSION: 1.01 (Dec 27, 2008)
# AUTHOR: Peter Cooper [ http://www.rubyinside.com/ github:peterc twitter:peterc ]
# DESCRIPTION: An "all in one" Sinatra library containing a User model and authentication
# system for both session-based logins OR HTTP Basic auth (for APIs, etc).
# This is an "all in one" system so you will probably need to heavily tailor
# it to your own ideas, but it will work "out of the box" as-is.
# COMPATIBILITY: - Tested on 0.3.2 AND the latest rtomayko Hoboken build! (recommended for the latter though)
# - NEEDS DataMapper!
# - Less work needed if you use initializer library -- http://gist.github.com/40238
# Edited pkgver and md5sum to grab 1.9.1-p376
# for reasons mentioned here:
# http://www.ruby-lang.org/en/news/2009/12/07/heap-overflow-in-string/
# http://www.ruby-lang.org/en/news/2009/12/07/ruby-1-9-1-p376-is-released/
# -----
# Danny Tatom <dannytatom2gmail.com>
# $Id: PKGBUILD 53111 2009-09-26 06:56:09Z allan $
# Maintainer: Allan McRae <allan@archlinux.org>
# Contributor: John Proctor <jproctor@prium.net>
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../lib/rules'
class ParseError < RuntimeError; end
module Parser
extend self
def is_valid_rule?(str)
$valid_rules.each do |key, regex|
return true if str.match(regex)