Skip to content

Instantly share code, notes, and snippets.

View washingtonsoares's full-sized avatar
🎯
Focusing

Washington Soares washingtonsoares

🎯
Focusing
View GitHub Profile
@washingtonsoares
washingtonsoares / digitalocean.md
Last active August 29, 2015 14:26 — forked from JamesDullaghan/digitalocean.md
Deploy rails app to digitalocean with nginx, unicorn, capistrano & postgres

Deploy Rails app to digitalocean with nginx, unicorn, capistrano & postgres

Create droplet of your liking (ubuntu 12.10 x32)

ssh to root in terminal with your server ip

ssh [email protected]

Add ssh fingerprint and enter password provided in email

@washingtonsoares
washingtonsoares / digital_ocean_setup.md
Last active August 29, 2015 14:26 — forked from ChuckJHardy/digital_ocean_setup.md
DigitalOcean Ubuntu 14.04 x64 + Rails 4 + Nginx + Unicorn + PostgreSQL + Capistrano 3 Setup Instructions
# MySQL. Versions 4.1 and 5.0 are recommended.
#
# Install the MySQL driver:
# gem install mysql2
#
# And be sure to use new-style password hashing:
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
development:
adapter: mysql2
encoding: utf8
@washingtonsoares
washingtonsoares / database.yml
Created March 4, 2016 00:50 — forked from danopia/database.yml
Default SQLite database.yml
# SQLite version 3.x
# gem install sqlite3-ruby (not necessary on OS X Leopard)
development:
adapter: sqlite3
database: db/development.sqlite3
pool: 5
timeout: 5000
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
@washingtonsoares
washingtonsoares / postgresql_configuration_on_ubuntu_for_rails.md
Created April 11, 2016 23:18 — forked from p1nox/postgresql_configuration_on_ubuntu_for_rails.md
PostgreSQL configuration without password on Ubuntu for Rails

Abstract

You could have postgre installed on localhost with password (or without user or password seted after instalation) but if we are developing we really don't need password, so configuring postgre server without password for all your rails project is usefull.

Install Postgre packages

  • postgresql
  • postgresql-client
  • libpq-dev
@washingtonsoares
washingtonsoares / BotãoWhatsApp.html
Created April 24, 2016 17:06 — forked from lucianobragaweb/BotãoWhatsApp.html
Como abrir o WhatsAPP no seu site
<!--
Subistitua o Número(8888387788) pelo seu número do WhatsApp
Siga este padrão: DDD + Numero, ex: 88 8838 7788 (Meu Número Whats)
-->
<a href="intent://send/8888387788#Intent;scheme=smsto;package=com.whatsapp;action=android.intent.action.SENDTO;end">Vamos Conversar?</a>
http://appcamp.io/courses/user-interface/layout-simple

http://thompsonemerson.github.io/ionic-collection/


## ionic examples
ionic start ionicApp
ionic start blankApp blank
ionic start tabsApp tabs
@washingtonsoares
washingtonsoares / git-zsh-checkout-autocomplete-local-only.md
Created October 15, 2016 22:17 — forked from mmrko/git-zsh-checkout-autocomplete-local-only.md
List only local branches when autocompleting git checkout (Zsh)
git config --global alias.checkoutr checkout
nano /usr/local/share/zsh/site-functions/git-completion.bash

...and then modify the file as follows...

-__gitcomp_nl "$(__git_refs '' $track)"
+if [ "$command" = "checkoutr" ]; then
+    __gitcomp_nl "$(__git_refs '' $track)"
+else
@washingtonsoares
washingtonsoares / spark.md
Created December 14, 2016 19:20 — forked from jesperfj/spark.md
Spark on Heroku

This guide will get you started using Spark on Heroku/Cedar. Spark is basically a clone of Sinatra for Java. 'Nuff said.

Create your app

Create a single Java main class in src/main/java/HelloWorld.java:

:::java
import static spark.Spark.*;
import spark.*;
@washingtonsoares
washingtonsoares / array_iteration_thoughts.md
Created January 13, 2017 14:58 — forked from ljharb/array_iteration_thoughts.md
Array iteration methods summarized

While attempting to explain JavaScript's reduce method on arrays, conceptually, I came up with the following - hopefully it's helpful; happy to tweak it if anyone has suggestions.

Intro

JavaScript Arrays have lots of built in methods on their prototype. Some of them mutate - ie, they change the underlying array in-place. Luckily, most of them do not - they instead return an entirely distinct array. Since arrays are conceptually a contiguous list of items, it helps code clarity and maintainability a lot to be able to operate on them in a "functional" way. (I'll also insist on referring to an array as a "list" - although in some languages, List is a native data type, in JS and this post, I'm referring to the concept. Everywhere I use the word "list" you can assume I'm talking about a JS Array) This means, to perform a single operation on the list as a whole ("atomically"), and to return a new list - thus making it much simpler to think about both the old list and the new one, what they contain, and