Skip to content

Instantly share code, notes, and snippets.

View j0lvera's full-sized avatar
🎯
Focusing

Juan Olvera j0lvera

🎯
Focusing
View GitHub Profile
@j0lvera
j0lvera / SassMeister-input.scss
Created September 11, 2014 21:53
Generated by SassMeister.com.
// ----
// Sass (v3.3.14)
// Compass (v1.0.1)
// ----
/*! Hyx.less v2.1.0 | MIT License | http://github.com/thinkxl/hyx.less */
// Settings
$gutter: 4%; // - distance between columns
$grid-size: 12; // - num of columns
@j0lvera
j0lvera / .zshrc
Last active August 29, 2015 14:06 — forked from SlexAxton/.zshrc
gifify() {
if [[ -n "$1" ]]; then
if [[ $2 == '--good' ]]; then
ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png
time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif
rm out-static*.png
else
ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif
fi
else
@j0lvera
j0lvera / social-options-wp.md
Last active October 15, 2017 15:04
How to add social icons using Option Tree and Font Awesome in WordPress

in header.php

<?php
  if ( function_exists( 'ot_get_option' ) ) {
    $social_media_channels = array(
      "Facebook" => "fa fa-facebook-square",
      "Twitter" => "fa fa-twitter-square",
      "Google+" => "fa fa-google-plus-square",
 "Linkedin" =&gt; "fa fa-linkedin-square",
@j0lvera
j0lvera / slugify.js
Created August 18, 2014 16:40
Slugify
String.prototype.slugify = function(){
var from = 'àáäãâèéëêìíïîòóöôõùúüûñç·/_,:;',
to = 'aaaaaeeeeiiiiooooouuuunc------',
i = from.length,
str = this;
while( --i >= 0 ){
str = str.replace(new RegExp(from.charAt(i), 'gi'), to.charAt(i));
}
@j0lvera
j0lvera / nickcolor3.pl
Created August 8, 2014 21:33
Modified version of nickcolor.pl
# A hacked version of the standard nickcolor.pl.
#
# The "vanilla" nickcolor would hash each nick to choose a color,
# essentially randomly coloring the names. This version tries to be a
# bit smarter: it uses a few criteria to try to decide on a
# color. When someone first starts talking, it will try to choose a
# color that's not in use by anyone else actively talking; if that
# fails, it will try to collide with a name that's not easily-confused
# with the one to which we're assigning a color. We also allow a name
# to be re-colored, but only if that person hasn't talked for a long
//
// Regular Expression for URL validation
//
// Author: Diego Perini
// Updated: 2010/12/05
// License: MIT
//
// Copyright (c) 2010-2013 Diego Perini (http://www.iport.it)
//
// Permission is hereby granted, free of charge, to any person
@j0lvera
j0lvera / keybase.md
Last active August 29, 2015 14:03
keybase

Keybase proof

I hereby claim:

  • I am thinkxl on github.
  • I am thinkxl (https://keybase.io/thinkxl) on keybase.
  • I have a public key whose fingerprint is CFF6 9B16 7F53 BC61 DFA9 C8C6 BACF 4830 71E4 5F7B

To claim this, I am signing this object:

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.

@j0lvera
j0lvera / readme.md
Created July 13, 2014 03:44
hyx.less read me

Hyx.less

Hyx is a very powerfull and easy to use grid system for less. Think of it like the missing half brother of Jeet.

Features

  • Flexible gutter size, you can change it whenever you want and your grid won't break.
  • If you prefer it doesn't full your HTML with a bunch of classes.
  • Powerful and semantic syntax, .cols(1/3); means one column of three.
  • Use only what you need when you need it, this is tool is to build a grid ad-hoc to your needs, you are no sticked to a rigid API or only one way to do stuff.
@j0lvera
j0lvera / app.lua
Created July 10, 2014 06:26 — forked from leafo/app.lua
local lapis = require "lapis"
local app = lapis.Application()
app:get("/", function()
local http = require "lapis.nginx.http"
local util = require "lapis.util"
local api = "https://www.googleapis.com/pagespeedonline/v1/runPagespeed?"
local res, status = http.simple(api .. util.encode_query_string {
url = "http://leafo.net",