Für den Boden:
- 150g Vollkornbutterkekse
- 2 EL Zucker
- Prise Zimt
- 60g weiche Butter
| # http://snippets.aktagon.com/snippets/445-How-to-create-a-JSONP-cross-domain-webservice-with-Sinatra-and-Ruby | |
| require 'sinatra/base' | |
| require 'json/pure' | |
| module JSONPatra | |
| class App < Sinatra::Base | |
| get "/" do | |
| callback = params['callback'] | |
| json = { :hello => "world!" }.to_json |
| module Devise | |
| module Orm | |
| module MongoMapper | |
| module Hook | |
| def devise_modules_hook! | |
| extend Schema | |
| include Compatibility | |
| yield | |
| return unless Devise.apply_schema | |
| devise_modules.each { |m| send(m) if respond_to?(m, true) } |
| #!/bin/bash | |
| # | |
| # Watch current directory (recursively) for file changes, and execute | |
| # a command when a file or directory is created, modified or deleted. | |
| # | |
| # Written by: Senko Rasic <[email protected]> | |
| # | |
| # Requires Linux, bash and inotifywait (from inotify-tools package). | |
| # | |
| # To avoid executing the command multiple times when a sequence of |
| #!/usr/bin/env ruby | |
| #/ Usage: <progname> [options]... | |
| #/ How does this script make my life easier? | |
| # ** Tip: use #/ lines to define the --help usage message. | |
| $stderr.sync = true | |
| require 'optparse' | |
| # default options | |
| flag = false | |
| option = "default value" |
| require 'rubygems' | |
| require 'bundler' | |
| Bundler.require | |
| require './application' | |
| namespace :assets do | |
| desc 'compile assets' | |
| task :compile => [:compile_js, :compile_css] do | |
| end |
| #!/bin/bash | |
| # Actual filename: bootstrap/rvm.erb | |
| # vim: set ft=sh | |
| # This script automatically bootstraps the system with everything it needs to run chef-solo. | |
| # Note: This should only do the absolute minimum necessary to get chef-solo (and your recipes) | |
| # working. All else should be done via chef recipes. | |
| #=================================================================================================== | |
| # Config |
| class PostsController < ActionController::Base | |
| def create | |
| Post.create(post_params) | |
| end | |
| def update | |
| Post.find(params[:id]).update_attributes!(post_params) | |
| end | |
| private |
Locate the section for your github remote in the .git/config file. It looks like this:
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = [email protected]:joyent/node.git
Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:
| auth_basic "Restricted"; | |
| auth_basic_user_file /etc/nginx/htpasswd; |