Skip to content

Instantly share code, notes, and snippets.

View andreloureiro's full-sized avatar

André Loureiro andreloureiro

  • Sao Paulo, Brazil
View GitHub Profile
@andreloureiro
andreloureiro / simple_facebook_share
Created July 13, 2013 15:28
Simple Facebook Share
<a href="https://www.facebook.com/sharer/sharer.php?u=andrel.me" target="_blank">
Share on Facebook
</a>
# Outputs the reading time
# Read this in “about 4 minutes”
# Put into your _plugins dir in your Jekyll site
# Usage: Read this in about {{ page.content | reading_time }}
module ReadingTimeFilter
def reading_time( input )
words_per_minute = 180
@andreloureiro
andreloureiro / gist:8861838
Created February 7, 2014 12:31
change_body_bg_color
window.setInterval(function(){
document.body.style.webkitTransition = '500ms all linear';
document.body.style.backgroundColor = '#'+Math.round(Math.random() * (999999 - 100000) + 100000)
},500)
#!/usr/bin/env ruby
# Author : Emad Elsaid (https://github.com/blazeeboy)
require 'sinatra'
set :port, 3000
set :environment, :production
get '/' do
<<-EOT
<html><head>

Rich Hickey on becoming a better developer

Rich Hickey • 3 years ago

Sorry, I have to disagree with the entire premise here.

A wide variety of experiences might lead to well-roundedness, but not to greatness, nor even goodness. By constantly switching from one thing to another you are always reaching above your comfort zone, yes, but doing so by resetting your skill and knowledge level to zero.

Mastery comes from a combination of at least several of the following:

/*
Template
<!DOCTYPE html>
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/rxjs/2.3.22/rx.all.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
(def init-state (atom {:title "Cycle!"}))
(defn main []
(let [{:keys [title]} @init-state
dom-obs (-> Observable
(.just title)
(.map #(div (h3 (str %)))))]
#js {:DOM dom-obs}))
(run main #js {:DOM (makeDOMDriver "#app")})
@andreloureiro
andreloureiro / .spacemacs
Created December 2, 2015 19:00
current spacemacs
;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
values."
(setq-default
;; Base distribution to use. This is a layer contained in the directory
(def state {:app/title "Market List"
:product/list []})