Skip to content

Instantly share code, notes, and snippets.

View wilkerlucio's full-sized avatar

Wilker Lúcio wilkerlucio

View GitHub Profile
@wilkerlucio
wilkerlucio / debounce.cljs
Created June 20, 2016 13:12 — forked from scttnlsn/debounce.cljs
core.async debounce
(defn debounce [in ms]
(let [out (chan)]
(go-loop [last-val nil]
(let [val (if (nil? last-val) (<! in) last-val)
timer (timeout ms)
[new-val ch] (alts! [in timer])]
(condp = ch
timer (do (>! out val) (recur nil))
in (if new-val (recur new-val)))))
out))
{
"estados": [
{
"sigla": "AC",
"nome": "Acre",
"cidades": [
"Acrelândia",
"Assis Brasil",
"Brasiléia",
"Bujari",
@wilkerlucio
wilkerlucio / example.scss
Last active May 20, 2019 15:12 — forked from darren131/gist:3410875
Compass sprite resize mixin
$my-icons-spacing: 10px; // give some space to avoid little pixel size issues on resize
@import "my-icons/*.png";
$my-icons-sprite-dimensions: true;
@include all-my-icons-sprites;
// the fun part
@wilkerlucio
wilkerlucio / testcase.html
Created December 15, 2011 01:36 — forked from nathanhammond/testcase.html
Simplified testcase for Ember bug.
<!doctype html>
<html lang="en">
<head>
<title>Ember Bug</title>
<script type="text/x-handlebars" data-template-name="president">
The President of the United States is {{name}}.
</script>
</head>
<body>
#!/usr/bin/env ruby
#
# Put this script in your PATH and download from onemanga.com like this:
# onemanga_downloader.rb Bleach [chapter number]
#
# You will find the downloaded chapters under $HOME/Documents/OneManga/Bleach
#
# If you run this script without arguments, it will check your local manga downloads
# and check if there are any new chapters
require 'rubygems'
@wilkerlucio
wilkerlucio / gist:58830
Created February 5, 2009 17:01 — forked from rails/gist:58761
Javascript Date Helper for distance in time
var DateHelper = {
// Takes the format of "Jan 15, 2007 15:45:00 GMT" and converts it to a relative time
// Ruby strftime: %b %d, %Y %H:%M:%S GMT
time_ago_in_words_with_parsing: function(from) {
var date = new Date;
date.setTime(Date.parse(from));
return this.time_ago_in_words(date);
},
time_ago_in_words: function(from) {