Skip to content

Instantly share code, notes, and snippets.

View lastk's full-sized avatar

Rafael Oliveira lastk

  • Salvador-Ba, Brazil
View GitHub Profile
@lastk
lastk / getting-started.md
Created August 14, 2018 11:37 — forked from joepie91/getting-started.md
Getting started with Node.js

"How do I get started with Node?" is a commonly heard question in #Node.js. This gist is an attempt to compile some of the answers to that question. It's a perpetual work-in-progress.

And if this list didn't quite answer your questions, I'm available for tutoring and code review! A donation is also welcome :)

Setting expectations

Before you get started learning about JavaScript and Node.js, there's one very important article you need to read: Teach Yourself Programming in Ten Years.

Understand that it's going to take time to learn Node.js, just like it would take time to learn any other specialized topic - and that you're not going to learn effectively just by reading things, or following tutorials or courses. _Get out there and build things!

@lastk
lastk / richhickey.md
Created April 22, 2018 19:52 — forked from prakhar1989/richhickey.md
richhickey.md

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:

@lastk
lastk / introrx.md
Created October 27, 2017 12:49 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@lastk
lastk / must-watch-talks.txt
Created July 4, 2017 14:56 — forked from leandrocp/must-watch-talks.md
must-watch talks
Rich Hickey
https://confreaks.tv/videos/railsconf2012-keynote-simplicity-matters
https://confreaks.tv/videos/jaxconf2012-keynote-the-value-of-values
Dave Thomas
https://confreaks.tv/videos/elixirconf2014-opening-keynote-think-different
https://confreaks.tv/videos/lonestarruby2013-elixir-power-of-erlang-joy-of-ruby
Robert Martin
https://confreaks.tv/videos/rubymidwest2011-keynote-architecture-the-lost-years
@lastk
lastk / TextTypeExtension.php
Created February 21, 2017 02:13 — forked from simshaun/TextTypeExtension.php
Symfony TextTypeExtension
<?php
namespace PlatformBundle\Form\Extension;
use Symfony\Component\Form\AbstractTypeExtension;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\Form\FormView;
use Symfony\Component\OptionsResolver\OptionsResolver;
@lastk
lastk / -
Created October 14, 2015 00:40
app/concepts/
|-- address
| `-- create_form.rb
|-- admin_user
| |-- create.rb
| `-- update.rb
|-- auto_investments
| `-- investment
| |-- create.rb
| |-- update.rb
@lastk
lastk / hook.rb
Last active August 29, 2015 14:13 — forked from dce/gist:44754
simple git commit hook
#!/usr/bin/ruby
require 'rubygems'
require 'git'
log = "~/gitlog.txt"
tmp = "/tmp/gitlog"
commit = Git.open('.').log.first
message = [
commit.date.strftime('%D'),

Overview

We run multiple server processes in two data centers. Each process listens on two ports, one for HTTP and one for HTTPS. HTTPS is terminated by Apache prior to reaching node.js. HTTP goes directly from the client to node.js (through a master load balancer). We do not use clusters. We slice our physical servers into thin virtual machines running SmartOS, each with about 3GB of memory designed for a single node.js process.

Our node.js servers are hapi.js servers using the composer functionality and plugins architecture. We have three sets of plugins loaded: mobile web front end experience (single page app), legacy API reverse proxy, and monitoring.

We also serve original node.js services off another server zone which runs closed source plugins using hapi.

Analytics

$(document).ready(function() {
if ($("[name='search']").length) {
$("[name='search']").each(function() {
var search = new Search.Input(this);
search.setBindings();
});
}
});
@lastk
lastk / gist:2413388
Created April 18, 2012 12:50 — forked from kurko/gist:2410930
DCI in real code
class ReceivablesManagementContext
def initialize(params)
@params = params
end
def save_receivable
sanitize_controller_params
@receivable = AccountReceivable.new(@params[:account_receivable])
@receivable.customer_id = @params[:customer_id]
@receivable.save