This file contains 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
# Mass-virtualhosting configuration for Nginx | |
# Sets up virtualhosts automatically, in the following way: | |
# test1.laas.tjs.ee -> /srv/laas/test1 | |
# app.tjs.ee -> /srv/prod/test1 | |
server { | |
# enable one of the following if you're on Linux or FreeBSD | |
listen 80 default deferred; # for Linux | |
# If you have IPv6, you'll likely want to have two separate listeners. |
This file contains 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
module ApplicationHelper | |
# Display alert box with message or optional block | |
def alert_box(alert_type = :info) | |
haml_tag :div, :class => 'row-fluid' do | |
haml_tag :div, :class => "span9 alert alert-#{alert_type}" do | |
haml_tag :a, '×', :class => 'close', :'data-dismiss' => 'alert' | |
block_given? ? yield : msg | |
end | |
end |
This file contains 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
# Variable declaration | |
le text = "Hello, Rage!" | |
le number = 2 | |
# Begin block with error handling | |
my poorly drawn code | |
# Conditionals | |
number < 3 seriously? | |
U don't say? |
This file contains 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 'listen' | |
require 'rb-readline' # <-- adding this fixes issues | |
require 'pry' | |
class MyGuard | |
attr_reader :thread | |
def initialize(dir) | |
callback = ->(*args){puts; puts "Got change: #{args.inspect}"} | |
@listener = Listen.to(dir).change(&callback) |
This file contains 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
# Helper for PostgreSQL Sequences | |
# USAGE: | |
# SequenceHelper.nextval('somenumber_seq') | |
# SequenceHelper.currval('somenumber_seq') | |
# SequenceHelper.reset('somenumber_seq', 10) | |
class SequenceHelper < ActiveRecord::Base | |
# Verify that the sequence exists or create it | |
def self.verify(name, create = true, initial_value=1) | |
name.downcase! |
This file contains 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
<?php | |
/** | |
* Controller is the customized base controller class. | |
* All controller classes for this application should extend from this base class. | |
*/ | |
class Controller extends CController | |
{ | |
// Rest of the Controller class |
This file contains 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
#!/bin/bash | |
function usage { | |
echo "USAGE: git merge-svn <from> [<to>]" | |
echo "" | |
echo " from The branch name to be merged FROM" | |
echo " to Optional branch name to be merged onto. Default: HEAD" | |
echo "" | |
} |
This file contains 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
<?php | |
/** | |
* Helper class for working with Assets | |
* | |
* @author Laas Toom, University of tartu | |
*/ | |
class sspmod_utmodule_Asset { | |
/** | |
* Get absolute URL to a specified asset. |
This file contains 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
#!/bin/bash | |
# This script is used make a full roundtrip test to SimpleSAMLphp based SSO | |
# Exit statuses indicate problem and are suitable for usage in Nagios. | |
BASENAME=$(basename $0) | |
if [[ $1 == '-h' || $1 == '--help' ]]; then | |
cat <<EOF | |
USAGE: $BASENAME [URL] [test-string] [username] [password] |
This file contains 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
et: | |
active_admin: | |
dashboard: Töölaud | |
dashboard_welcome: | |
welcome: "Tere tulemast Active Adminisse. See on vaikimisi töölaud." | |
call_to_action: "Et lisada töölauale sektsioonie, uuri 'app/admin/dashboard.rb'" | |
view: "Vaata" | |
edit: "Muuda" | |
delete: "Kustuta" | |
delete_confirmation: "Oled sa kindel, et soovid seda kustutada?" |