Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View orioltf's full-sized avatar

Oriol Torrent Florensa orioltf

View GitHub Profile
@orioltf
orioltf / Rating-module.markdown
Last active August 29, 2015 14:01
#MODULE #CODEPEN Rating module. A Pen by orioltf.
@orioltf
orioltf / introrx.md
Created July 1, 2014 10:26 — forked from staltz/introrx.md
introduction to Reactive Programming

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.

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
<style>
body { font-family: Helvetica; line-height: 1.3em; padding: 1em 10%; }
</style>
</head>
<body>
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@orioltf
orioltf / equalizeHeights.js
Last active August 29, 2015 14:21
#JQUERY #UTIL equalizeHeights
/**
* Set the height from every jQuery element to the highest of the elements.
* @returns {object} the jquery objects passed in with the new height.
*/
$.fn.equalizeHeights = function() {
var maxHeight = 0,
itemHeight = 0;
this.each(function(index, element) {
var $element = $(element);
@orioltf
orioltf / getHeightIn.js
Last active August 29, 2015 14:21
#JQUERY #UTIL getHeightIn
/**
* Gets the height from the provided elements, even if they are hidden
* @param {Object} $context - the jQuery DOM element where to append the object so that it gets proper styling
* @returns {Number} - the outerHeight value from the passed $element
*/
$.fn.getHeightIn = function($context) {
var $element = this,
$wrap = $('<div />'),
$clone, height;
@orioltf
orioltf / cookies.js
Created May 20, 2015 12:53
#JS #UTIL cookies.js
/*\
|*|
|*| :: cookies.js ::
|*|
|*| A complete cookies reader/writer framework with full unicode support.
|*|
|*| Revision #1 - September 4, 2014
|*|
|*| https://developer.mozilla.org/en-US/docs/Web/API/document.cookie
|*| https://developer.mozilla.org/User:fusionchess
@orioltf
orioltf / clone_objects.js
Last active August 29, 2015 14:21
#JS #UTIL Clone objects
/**
* In JavaScript assigning an Object to a new variable creates a reference to the original object. This means that changes to an element from the original object will be reflected on the new variable too. This util effectively duplicates a given Object/Array. Drawback: this action will increase the memory usage from your application.
* @param {Object|Array} source - the source object or Array to be duplicated.
* @returns {Object|Array} either the duplicated Object/Array or the original source element if it is neither an Object nor an Array.
*/
var clone = function(source) {
var copy, i;
if (Object.prototype.toString.call(source) === '[object Array]') {
copy = [];
for (i=0; i<source.length; i++) {
@orioltf
orioltf / dabblet.css
Created December 17, 2011 13:48
#CSS: CSS only visual rich section division
/**
* CSS only visual rich section division
*/
body {
background-color: #264e86;
color: #fff;
font-size: 2em;
}
#main {
width: 90%;
@orioltf
orioltf / dabblet.css
Last active September 29, 2015 11:28
#CSS #CSS3: Styling Button Links With CSS3
/**
* Styling Button Links With CSS3
* Credit: http://www.usabilitypost.com/2012/01/10/pressed-button-state-with-css3/
*/
/* Step 1: the button */
.button-link {
padding: 10px 15px;
background: #4479BA;
color: #FFF;
text-decoration: none;