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
#!/usr/bin/env ruby -w | |
# Resitev naloge: http://wiki.fmf.uni-lj.si/wiki/Naloga:_program_Pretvarjanje_minut | |
stevilo = ARGV[0].to_i | |
ure = stevilo / 60 | |
minute = stevilo % 60 | |
puts "#{stevilo} min = #{ure} h #{minute} min" |
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
#!/usr/bin/env ruby -w | |
operacija = ARGV[0] | |
a = ARGV[1].to_i | |
b = ARGV[2].to_i | |
if operacija == "sestej" | |
rezultat = a+b | |
elsif operacija == "odstej" |
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
#!/usr/bin/env bash | |
S_COMMAND_A=$1 | |
S_COMMAND_B=$2 | |
S_COMMAND_C=$3 # token | |
echo $S_COMMAND_A | |
echo $S_COMMAND_B | |
echo $S_COMMAND_C |
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
#!/usr/bin/env ruby -w | |
sirina = ARGV[0].to_i | |
visina = ARGV[1].to_i | |
if sirina == 0 or visina == 0 | |
puts "Manjkajo dimenzije pravokotnika" | |
exit | |
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
# Simple Recommendation Engine in Ruby | |
# Visit: http://otobrglez.opalab.com | |
# Author: Oto Brglez <otobrglez@gmail.com> | |
class Book < Struct.new(:title) | |
def words | |
@words ||= self.title.gsub(/[a-zA-Z]{3,}/).map(&:downcase).uniq.sort | |
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
# By Oto Brglez - <otobrglez@gmail.com> | |
# | |
# Problem: Sometimes you have project that is build out of many "sub-projects", | |
# sub-project, can be anything, gem, rails app to single page app. And then you | |
# want to run specs for each of this project to see if everything works. Then what? | |
# | |
# Solution: On your "root" folder create Rake task that goes and executes test suite | |
# for each project and summers everything into report. Well... At least thats what this is. ;) | |
# | |
# Cheers, |
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
# Users mono | |
# Install mono via Homebrew | |
# brew install mono | |
hello.exe: | |
gmcs hello.cs | |
clean: | |
rm -rf *.exe |
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
#!/usr/bin/env bash | |
# Target host: http://aioo-api.dev | |
# Testing from origin: http://aioo-spa.dev | |
# Method: "POST" | |
curl --verbose --request OPTIONS http://aioo-api.dev \ | |
--header 'Origin: http://aioo-spa.dev' \ | |
--header 'Access-Control-Request-Headers: Origin, Accept, Content-Type' \ | |
--header 'Access-Control-Request-Method: POST' |
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
#!/usr/bin/env bash | |
# 1. Make it executable 'chmod +x zzzs-validator.sh' | |
# 2. Use it './zzzs-validator.sh <ZZZV NUMBER> | |
HOST="https://zavarovanec.zzzs.si" | |
ANOY_SEC="/!ut/p/b1/lY_bboMwEES_JV_gtcHGeXQNKfcmITjBL4jeIhCBkkZI4evrRn1Ib6q60mq10hnNDNKoIBzsObcY2iHdVWO9r05131Xt-69ZySARfgDY50IyCOJcKU85AA4xQHEN3NmKGsCz3DBhGCT8U8_tUEBAWUwdOicA-C_9Fu3ALrOGvyTn0y6e5LhpptX51WzSyCl1JU7T5fJRrfMbIW-TY0dQiPS-7e9NvS3Snw1-yP8lwfeAFwB-GQEo9fvDEyoM5lwZycg0sSDHVEpsDtp8NGHDMNRHEnGcZrWVNVMmxYgf1qAWIiIFKfkMHXS7iGnoPbur2RveW3Gk/dl4/d5/L0lDU0lKSmdwcG1BIS9JTFNBQ0lpTXlDb2tBRUFtaWdiaVFDQUEvNEczYUQyZ2p2eWhEVXdnIS9aN182ME1BSEkwMUhPQ0s2MEkzMFUxNUNDMTBVMS8wLzI2OTIyMDY5MzkzOQ!!/" | |
ENDPOINT_URL="${HOST}/wps/portal/portali/azos/status_zavarovanja${ANOY_SEC}" | |
curl -si -X POST \ |
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
#!/usr/bin/env ruby | |
# Use it like this: | |
# token=access_token_here ./fetcher.rb | |
require 'bundler/setup' | |
require 'koala' | |
require 'chronic' | |
class Fetcher |