Skip to content

Instantly share code, notes, and snippets.

Hrvoje Šimić shime

Block or report user

Report or block shime

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
shime / gist:1077934
Created Jul 12, 2011
Initialize compass in new rails app
View gist:1077934
compass init rails . --using blueprint
View render_links.js.erb
shime / instance_eval explanation.rb
Created Jan 14, 2012
instance_eval explanation
View instance_eval explanation.rb
val = "pizdarija"
val.instance_eval do
def randomize
View proba.c
#include <stdio.h>
int main(){
int i = 0;
int random;
for (i=0;i < 10;i++){
random = rand()%1000;
return 0;
shime / hello.rb
Created Jan 20, 2012
hello world in sinatra
View hello.rb
require 'sinatra'
get '/hi' do
"hello world!"
shime / example_controller.rb
Created Feb 16, 2012
sending errors to Exceptional with rescue_from
View example_controller.rb
class ExampleController < ApplicationController
rescue_from Exception, :with => :render_custom
def render_custom(exception)
if Exceptional::Remote.error(, "Test Exception")) "Exceptional: #{exception.class} has been reported to Exceptional"
Rails.logger.error "Exceptional: Problem sending exception. Check your API key."
View prvi_zadatak.rb
### Brojčano na ekranu ispišite koliko godina ima sekundi.
### Koliko imate godina ako ste stari 8286 dana?
View drugi_zadatak.rb
### Ispišite svoje ime i prezime unatrag
### Ispišite trece slovo svog imena velikim slovom
shime / javascript_notifier.html
Created Feb 23, 2012
HTML code for Airbrake javascript notifier
View javascript_notifier.html
<script type="text/javascript">
var notifierJsScheme = (("https:" == document.location.protocol) ? "https://" : "http://");
document.write(unescape("%3Cscript src='" + notifierJsScheme + "' type='text/javascript'%3E%3C/script%3E"));
</script><script src="" type="text/javascript"></script>
View treći_zadatak.rb
### Napišite program koji ce ispisivati string od 10 slova i 5 znamenki
### i to svaki put u drukcijem rasporedu
### Napišite program koji ce ispisati brojeve od 1 do 10, svaki u svom redu
You can’t perform that action at this time.