Skip to content

Instantly share code, notes, and snippets.

View splattael's full-sized avatar
🏠
Working from home

Peter Leitzen splattael

🏠
Working from home
View GitHub Profile
$ irb
>> i = 2
=> 2
>> i *= 2
=> 4
>> (_*_) # use the butt operator
=> 16
>> i = 0
=> 0
>> (_.._) # plunging neckline
Rails CMS alternatives
======================
Note: project activity was checked on 11/26/09.
Active projects:
---------------
adva-cms
repo: http://github.com/svenfuchs/adva_cms/
site: http://adva-cms.org/
Last update: 11/24/09
We couldn’t find that file to show.
#!/bin/bash
# A generator for a nicely tweaked rsnapshot configuration
# it collects in and exclude from rsnapshot files in the VZ and the Host roots.
# such files could look like following:
# > cat /rsnapshot
# /
# !/var/log
# !/tmp
=# gem install simple_form
= simple_form_for @article do |f|
= f.association :research, :prompt => 'select'
@splattael
splattael / mail_queue.rb
Created April 28, 2011 09:35 — forked from scottwater/mail_queue.rb
A really simple general purpose mail queue for resque
module MailQueue
extend self
def queue
:default
end
def perform(mailer_class, method, *args)
mailer = const_get mailer_class
mailer.send(method, *args).deliver
@splattael
splattael / rails_3_1_beta_1_changes.md
Created May 10, 2011 06:52 — forked from ryanb/rails_3_1_rc4_changes.md
The Changelogs for Rails 3.1 Beta 1

Railties 3.1 Beta 1

  • The -j option of the application generator accepts an arbitrary string. If passed "foo", the gem "foo-rails" is added to the Gemfile, and the application JavaScript manifest requires "foo" and "foo_ujs". As of this writing "prototype-rails" and "jquery-rails" exist and provide those files via the asset pipeline. Default is "jquery". [fxn]

  • jQuery is no longer vendored, it is provided from now on by the jquery-rails gem. [fxn]

  • Prototype and Scriptaculous are no longer vendored, they are provided from now on by the prototype-rails gem. [fxn]

  • The scaffold controller will now produce SCSS file if Sass is available [Prem Sichanugrist]

@splattael
splattael / vzquota.sh
Created June 21, 2011 16:14 — forked from holderbaum/vzquota.sh
Little helper-script for openvz-diskquota management
#!/bin/sh
if [ $# -eq 1 ]
then
VEID=$1
echo -n "space...: "
USAGE=$(grep -A2 "103" /proc/vz/vzquota|sed -n '2,2p'|awk '{print $2}')
SOFTLIMIT=$(grep -A2 "103" /proc/vz/vzquota|sed -n '2,2p'|awk '{print $3}')
HARDLIMIT=$(grep -A2 "103" /proc/vz/vzquota|sed -n '2,2p'|awk '{print $4}')
@splattael
splattael / gist:5899463
Last active December 19, 2015 04:48 — forked from schneems/gist:5897076
require 'benchmark/ips'
class Foo
def bar
1
end
end
foo = Foo.new
def extract_log(dir)
`(cd #{dir} && git log --oneline --shortstat --pretty=format:%aE)`
end
def extract_stats(log_string)
log_string.split(/\n\n/).map do |log_entry|
StatEntry.new log_entry
end
end