Skip to content

Instantly share code, notes, and snippets.

View andreloureiro's full-sized avatar

André Loureiro andreloureiro

  • Sao Paulo, Brazil
View GitHub Profile
var faker = require('faker');
module.exports = function() {
var db = { promotions: [] };
var total = 0;
while (total < 30) {
var title = faker.commerce.productName();
db.promotions.push({
(def state {:app/title "Market List"
:product/list []})
(def state {:app/title "Market List"
:product/list []})
@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 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")})
/*
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>

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:

#!/usr/bin/env ruby
# Author : Emad Elsaid (https://github.com/blazeeboy)
require 'sinatra'
set :port, 3000
set :environment, :production
get '/' do
<<-EOT
<html><head>
@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)