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 / introrx.md
Last active August 29, 2015 14:07 — forked from staltz/introrx.md

The introduction to Reactive Programming you've been missing

(by @andrestaltz)

So you're curious in learning this new thing called (Functional) Reactive Programming (FRP).

Learning it is hard, even harder by the lack of good material. When I started, I tried looking for tutorials. I found only a handful of practical guides, but they just scratched the surface and never tackled the challenge of building the whole architecture around it. Library documentations often don't help when you're trying to understand some function. I mean, honestly, look at this:

Rx.Observable.prototype.flatMapLatest(selector, [thisArg])

Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.

@Krule
Krule / template.rb
Last active August 29, 2015 14:01
Basic rails template
generate(:controller, "app index")
route "root to: 'app#index'"
git :init
git add: "."
git commit: %Q{ -m 'Initial commit' }
# Gems
gem 'rails'
gem ''
<!-- ~/Library/Application Support/Sublime Text 3/Packages/User/Ruby/pry.sublime-snippet -->
<snippet>
<content><![CDATA[require 'pry'; binding.pry]]></content>
<tabTrigger>pry</tabTrigger>
<scope>source.ruby</scope>
<description>binding.pry</description>
</snippet>
@Krule
Krule / labels.tex
Created December 3, 2012 15:54
When I need a lots of same label
\documentclass[a4paper]{article}
\usepackage[newdimens]{labels}
\usepackage[utf8]{inputenc}
\LabelCols=4
\LabelRows=10
\LabelGridtrue
\numberoflabels=40
\LabelInfotrue
@Krule
Krule / jQuery.thatHasNo.coffee
Created December 30, 2011 14:19
That Has No
jQuery.fn.thatHasNo = (element, method = "children") ->
@.not ->
$(@)[method](element).length
@Krule
Krule / environment.rb
Created July 8, 2011 10:11 — forked from joshuap/environment.rb
Net:HTTP enabled URI Validator for Rails 3
...
require 'uri_validator'
@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
@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 / 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 / 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