Skip to content

Instantly share code, notes, and snippets.

View Krule's full-sized avatar
🍐
Fruity

Armin Pašalić Krule

🍐
Fruity
View GitHub Profile
@Krule
Krule / articles_controller.rb
Created July 16, 2010 13:13
Pluralize using Rails 3 in Slovenian language
class ApartmentsController < ApplicationController
def index
@apartments = Apartment.all
end
end
@Krule
Krule / radio-sarajevo.html
Created September 26, 2010 02:26
HTML5 Radio Sarajevo
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>Radio</title>
</head>
<body>
<audio src="http://malla.softnet.si:8000/" controls preload> </audio>
</body>
</html>
@Krule
Krule / cv.tex
Last active June 28, 2022 10:22
My expanded CV
\documentclass[letterpaper]{article}
\usepackage{color,hyperref,geometry,subfigure,fancyhdr,sectsty,pstricks}
\usepackage[utf8x]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[sc,osf]{mathpazo}
\usepackage{adforn}
\usepackage{soul}
\usepackage{setspace}
\usepackage{scrextend}
// Based on http://snipt.net/boriscy/datetime-jquery-formtastic/
$.tools.dateinput.localize("ja", {
months: '1月,2月,3月,4月,5月,6月,7月,8月,9月,10月,11月,12月',
shortMonths: '1月,2月,3月,4月,5月,6月,7月,8月,9月,10月,11月,12月',
days: '日曜日,月曜日,火曜日,水曜日,木曜日,金曜日,土曜日',
shortDays: '日,月,火,水,木,金,土'
});
$.tools.dateinput.conf.format = 'yyyy-mm-dd';
@Krule
Krule / application.js
Created January 20, 2011 15:05
Example for Marko
/*
=form_for :sendemail, :url => :sendemail_index,:remote => true, :html => { :"data-name" => "Contact ASC Admin", :"data-cancelable" => true }
*/
var Asc = {
center: $(window).width() / 2,
_init: function(){
Asc.notice_fade()
@Krule
Krule / pdf_to_swf.rb
Created January 24, 2011 09:31
Paperclip pdf2swf processor utilizing swftools
module Paperclip
class PdfToSwf < Processor
attr_accessor :params
def initialize file, options = {}, attachment = nil
super
@file = file
@params = options[:params]
@current_format = File.extname(@file.path)
@Krule
Krule / get_params.js
Created January 26, 2011 13:04
Small javascript snippet to convert location.search parameters and return them as hash
/**
* Returns location search parameters as hash, so we can
* use them more naturally in our javascript. Like...cough... rails :P
*
* Example url: http://my_domain.ext/?page=products&condition=cheap
*
*
* var params = get_params();
*
* alert( params['page'] ); // => products
@Krule
Krule / SoapClientDebug.php
Created February 15, 2011 20:53
PHP Class for debugging SOAP requests
<?php
class SoapClientDebug extends SoapClient
{
public function __doRequest($request, $location="", $action="", $version=0, $one_way=0) {
echo "<pre>" . preg_replace('/&gt;&lt;/', '&gt;<br>&lt;', htmlentities($request)) . "</pre>";
return parent::__doRequest($request, $location, $action, $version);
}
}
@Krule
Krule / eogs.php
Created February 16, 2011 13:29
Eogs class is a collection of methods used to communicate with cvr.dk SOAP service. Note: PHP must be compiled with SOAP, Curl, OpenSSL. On OS X (10.6.4+) OpenSSL lacks renegotiation support so it, and Curl afterward, must be recompiled from source before
<?php
/**
*
* Eogs (V .4) class is a collection of methods used to communicate with cvr.dk SOAP
* service.
*
* Details on @link http://archprod.service.eogs.dk/cvronline/metacvronline/urls.htm
*
* @note .4 contains only adapters for two interfaces.
@Krule
Krule / config.ru.rb
Created April 21, 2011 07:54 — forked from brianmario/config.ru.rb
minimal rails3 app
# minimal rails3 app
require 'action_controller'
Router = ActionDispatch::Routing::RouteSet.new
Router.draw do
root :to => 'site#index'
end
class SiteController < ActionController::Metal