This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
commit e69b947e134420e1a538220de5bf5501390a6e43 | |
Author: Maarten Hoogendoorn <[email protected]> | |
Date: Thu Sep 12 10:12:56 2013 +0200 | |
Adapt Makefile so that it runs both on my machine as the UvA machines | |
diff --git a/Makefile b/Makefile | |
index 49430e4..71b0200 100644 | |
--- a/Makefile | |
+++ b/Makefile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
h$ erl -pa ebin/ | |
Erlang R16B01 (erts-5.10.2) [source-bdf5300] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false] | |
Eshell V5.10.2 (abort with ^G) | |
1> c(simple_search_server). | |
simple_search_server.erl:none: no such file or directory | |
error | |
2> l(simple_search_server). | |
{module,simple_search_server} | |
3> simple_search_server:start_link(). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env ruby | |
def get_env_or_fail(name) | |
if ENV.has_key?(name) | |
ENV[name] | |
else | |
$stderr.puts "Missing variable: #{name}" | |
exit 1 | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'capybara/dsl' | |
require 'capybara-webkit' | |
include Capybara::DSL | |
Capybara.current_driver = :webkit | |
Capybara.app_host = "http://vunet.vu.nl" | |
module Runner | |
extend self |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Person | |
include Webhook | |
end | |
module Webhook | |
included do | |
before_save :store_changes | |
after_save :execute_webhook_after_save | |
after_destroy :execute_webhook_after_destroy | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# service nginx configtest | |
Testing nginx configuration: nginx: [emerg] unknown directive " " in /etc/nginx/sites-enabled/paagrank:5 | |
nginx: configuration file /etc/nginx/nginx.conf test failed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <unistd.h> | |
#include <signal.h> | |
static char keep_running; | |
void handler(int signal) { | |
printf("Got signal %i, closing down soon!\n", signal); | |
keep_running = 0; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class I18n | |
method_alias_chain :translate, :helper | |
DEFAULTMEHOPTIONS= {helper: true} | |
def translate_with_helper key, options | |
options = DEFAULTMEHOPTIONS.merge(options) | |
txt = translate_without_helper key, options |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# routes.rb is the same | |
# app/controllers/application_controller.rb | |
class ApplicationController < ActionController::Base | |
include ApplicationHelper # Force it to be present in all controllers | |
before_filter :find_login_and_account | |
end | |
# app/helpers/application_helper.rb | |
module ApplicationHelper |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# routes.rb | |
TestApp::Application.routes.draw do | |
resources :logins | |
resource :session | |
resources :accounts do | |
resources :things | |
end | |
end |