Skip to content

Instantly share code, notes, and snippets.

View datenimperator's full-sized avatar

Christian Aust datenimperator

View GitHub Profile
def init
if super_init
@identified = false
@dirty = false
@username, @password, @account_type = 'test', 'abc', SIP_TEAM
self
end
end
#
# SipFaxPref.m
# SipFax
#
# Created by Christian on 12.10.09.
# Copyright (c) 2009 Christian Aust. All rights reserved.
#
require 'osx/cocoa'
require 'client'
christian@macbookpro:~/Documents/Projekte/SipFax\ otool -L build/Debug/SipFax.prefPane/Contents/MacOS/SipFax
build/Debug/SipFax.prefPane/Contents/MacOS/SipFax:
/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 12.0.0)
/System/Library/Frameworks/PreferencePanes.framework/Versions/A/PreferencePanes (compatibility version 1.0.0, current version 1.0.0)
@executable_path/../Frameworks/RubyCocoa.framework/Versions/A/RubyCocoa (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/Security.framework/Versions/A/Security (compatibility version 1.0.0, current version 36371.0.0)
@loader_path/../Frameworks/BWToolkitFramework.framework/Versions/A/BWToolkitFramework (compatibility version 1.0.0, current version 0.0.0)
@loader_path/../Frameworks/EMKeychain.framework/Versions/A/EMKeychain (compatibility version 1.0.0, current version 1.0.0)
@executable_path/../Frameworks/XMLRPC.framework/Versions/A/XMLRPC (compatibility version 1.0.0, cur
$ radiant --database=mysql test
$ sudo gem install thinking-sphinx
$ cd test
# set your mysql credentials for production
$ joe config/database.yml
# add config.gem 'mislav-will_paginate', :lib => 'will_paginate'
$ joe config/environment.rb
$ export RAILS_ENV=production
tell application "Address Book"
set mylist to selection
repeat with this_person in mylist
set new_note to ""
set tmp to (get note of this_person)
set the_paragraphs to the paragraphs of tmp
repeat with the_paragraph in the_paragraphs
if the_paragraph does not contain "CLASS:" and the_paragraph does not contain "xing" then
set new_note to new_note & the_paragraph
end if
#
# MyDocument.rb
# xing2
#
# Created by Christian on 17.04.10.
# Copyright (c) 2010 __MyCompanyName__. All rights reserved.
#
require 'osx/cocoa'
@datenimperator
datenimperator / gist:829803
Created February 16, 2011 17:48
Hausnummer klein ohne Leerzeichen
"Höhenweg 17 B".gsub(/(\d)\s(\w)$/) { "#{$1}#{$2.downcase}" }
@datenimperator
datenimperator / gist:1010336
Created June 6, 2011 14:10
dmesg on virtual Ubuntu 10.04.2
administrator@router:~$ dmesg
[ 0.000000] Initializing cgroup subsys cpuset
[ 0.000000] Initializing cgroup subsys cpu
[ 0.000000] Linux version 2.6.32-32-generic-pae (buildd@roseapple) (gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5) ) #62-Ubuntu SMP Wed Apr 20 22:10:33 UTC 2011 (Ubuntu 2.6.32-32.62-generic-pae 2.6.32.38+drm33.16)
[ 0.000000] KERNEL supported cpus:
[ 0.000000] Intel GenuineIntel
[ 0.000000] AMD AuthenticAMD
[ 0.000000] NSC Geode by NSC
[ 0.000000] Cyrix CyrixInstead
[ 0.000000] Centaur CentaurHauls
@datenimperator
datenimperator / gist:1241937
Created September 26, 2011 09:35
Create instance-based validation
require 'rubygems'
gem 'activemodel', '3.0.10'
require 'active_model'
class ChildValidator < ActiveModel::EachValidator
def validate_each(object, attribute, child)
klass = "#{object.process}_child_validator".camelize.constantize rescue nil
child.validates_with klass unless klass.nil?
unless child.errors.empty?
object.errors[attribute] << child.errors.full_messages
# Compass configuration from inside a rails3 engine
require 'compass'
require 'compass/app_integration/rails'
configuration = StringIO.new(<<-CONFIG)
project_type = :rails
css_dir = "public/stylesheets"
sass_dir = "app/stylesheets"
CONFIG