Skip to content

Instantly share code, notes, and snippets.

View HusseinMorsy's full-sized avatar

Hussein Morsy HusseinMorsy

  • morSystem GmbH
  • Düsseldorf, Germany
View GitHub Profile
class ActiveRecord::Base
def self.acts_as_yaffle(options={})
# ...
end
def squawk
# ....
end
module AddTopNavigation
module ClassMethods
def add_top_navigation( opts = {} )
before_filter opts do |controller|
controller.send(:add_top_navigation, opts)
end #before_filter
end
end
require 'rubygems'
require 'nokogiri'
require 'open-uri'
# remove xmlns="http://www.blinksale.com/api from xml document to work
file_name = "blinksale-data.xml"
file =File.open(file_name, 'r')
after 'deploy:update_code', 'deploy:bundle_install'
namespace :deploy do
task :bundle_install do
run("cd #{release_path} && bundle install")
end
end
@HusseinMorsy
HusseinMorsy / Gemfile
Created September 16, 2011 11:17
Alternative URL for rubygems
#source 'http://rubygems.org'
source 'http://production.s3.rubygems.org/'
Demo2::Application.routes.draw do
get "bookmakrs/new"
get "bookmakrs/edit"
get 'hello' => "bookmarks#hello"
get 'bookmarks/hello' => "bookmarks#hello"
# statt der letzten Zeile geht auch einfach"
get 'bookmarks/hello'
end
body {
background-color: #fff;
color: #333;
font-family: verdana, arial, helvetica, sans-serif;
font-size: 13px;
line-height: 18px; }
p, ol, ul, td {
font-family: verdana, arial, helvetica, sans-serif;
font-size: 13px;
komplexe Suchabfragen
Folgendes Beispiel:
Für den Airbus A380 gibt es besondere Anforderungen an den Flughafen, damit dieser Flugzeugtyp dort laden darfen.
Attribut a380_allowed.
Wir hätten alle Länder gelistet, die Flughäfen haben, auf denen der Airbus A380 landen darf.
Das Problem besteht darin, dass das a380_allowed kein Attribut des Country-Model ist, denn
@HusseinMorsy
HusseinMorsy / pomodoro.rb
Created March 18, 2012 00:33
script for pomodoro timer with tmux and Pomodoro-App
#!/usr/bin/env ruby
#
# for use with ugol's pomodoro app (https://github.com/ugol/pomodoro) and tmux
# use applescript to set the time
# How to use it:
# 1. Open preferences from the pomodoro app
# 2. Choose script
# 3. Set start, reset and end to: do shell script "/usr/local/bin/pomodoro reset"
# 4. set every 1 min to: do shell script "/usr/local/bin/pomodoro decrease"
@HusseinMorsy
HusseinMorsy / README.md
Last active December 17, 2015 02:49
Install node on Raspbian wheezy

Install node on Raspbian wheezy

See on http://nodejs.org/ for the latest node version (e.g. v0.10.5)

  1. sudo apt-get install git-core
  2. cd ~
  3. mkdir tmp
  4. git clone https://github.com/joyent/node.git
  5. cd node