Skip to content

Instantly share code, notes, and snippets.

View vedadsose's full-sized avatar
🌏

Vedad Šoše vedadsose

🌏
View GitHub Profile
@vedadsose
vedadsose / timeSince.js
Created May 6, 2015 12:13
Time since js verzija - BHS jezik
function timeSince(datum) {
var razlika = (Date.now() - Date.parse(datum).getTime())/1000;
var rezultat;
if (razlika<60) {
if (razlika == 1 || (razlika>20 && razlika%10==1)) {
rezultat = "prije "+razlika+" sekundu";
}
else if (razlika <= 4 || (razlika >20 && razlika%10<=4)) {
rezultat = "prije "+razlika+" sekunde";
@vedadsose
vedadsose / watermark.rb
Created October 13, 2015 16:22
Paperclip watemark
module Paperclip
class Watermark < Processor
def initialize(file, options = {}, attachment = nil)
super
geometry = options[:geometry]
@file = file
@crop = geometry[-1,1] == '#'
@target_geometry = Geometry.parse geometry
@current_geometry = Geometry.from_file @file
@convert_options = options[:convert_options]