Skip to content

Instantly share code, notes, and snippets.

View shime's full-sized avatar

Hrvoje Šimić shime

View GitHub Profile
### Ispišite sve brojeve od 1 do 100, svaki u svom redu
### Ispišite brojeve od 17 do 32 u jednom redu, odvojite ih zarezom
### Ispišite random brojeve od 50 do 110 u jednom redu, odvojite ih zarezom
### a) Ispišite sve brojeve od 1 do 1000 koji su djeljivi sa 13 ili 7
### b) Napravite novi rječnik koji će sadržavati dva ključa.
### Ključevi: 15, 7
###
### Pod ključem "15" u ovom hashu moraju biti svi brojevi
### od 1 do 1000 djeljivi sa 15
### Pod ključem "7" u ovom hashu moraju biti svi brojevi
### od 1 do 1000 djeljivi sa 7
### Napišite metodu koja prima string i vraća broj pojavljivanja slova a u tom stringu
### Napišite metodu koja prima string a ispisuje ga unazad
### 1. Create user class by implementing
### a. properties
### i. user_id
### ii. username
### iii. password
### iv. email
### b. methods
### i. greet (learn user to say "Hi! My name is <name>, nice to meet you."
###
@shime
shime / custom_sender_example.rb
Created February 28, 2012 14:23
conditioning airbrake at runtime
class CustomSender < Airbrake::Sender
alias_method :orig_send, :send_to_airbrake
def send_to_airbrake(data)
return if Random.new.rand(10..20).odd?
orig_send(data)
end
end
Airbrake.sender = CustomSender.new(Airbrake.configuration)
@shime
shime / test_airbrake.rb
Created March 9, 2012 18:35
test airbrake
(1..100).select { Airbrake.notify(:error_class => "Testing success rate",:error_message => "Error Message") }.length / 100.0

#RPPP INTERVJU

informatizacija vlastitog poslovanja - radimo projekte na zavodu

projekti: znanstveni, nastavni, međunarodni (fp6,fp7) - o rezultatima projekata pišu se neki radovi, evidentiraju se podaci

kad se napravi projekt, evidentira se rad i autori

različite vrste radova: studija, elaborat, članak u časopisu, diplomski, doktorska dizertacija, poglavlje u knjizi

@shime
shime / Gemfile
Created April 2, 2012 17:16
Rails Lightweight Stack. Most of this is detailed on Crafting Rails Applications - http://pragprog.com/book/jvrails/crafting-rails-applications
source :rubygems
# We are not loading Active Record, nor Active Resources etc.
# We can do this in any app by simply replacing the rails gem
# by the parts we want to use.
gem "actionpack", "~> 3.2"
gem "railties", "~> 3.2"
gem "tzinfo"
# Let's use thin
@shime
shime / example.sh
Created April 3, 2012 11:04
Using a local clone of rails for development
$ ruby /path/to/rails/railties/bin/rails new myapp --dev
@shime
shime / airbrake.rb
Created April 4, 2012 16:23
[Airbrake] little hack to receive email on every occurrence of exception
Airbrake.configure do |config|
config.api_key = '092f2e6780f7c9117353d28dbe8486a3'
config.development_environments = []
end
module Airbrake
module Customization
def self.included(base) #:nodoc:
base.send(:alias_method_chain,:initialize,:customization)
end