Skip to content

Instantly share code, notes, and snippets.

View renatoalencar's full-sized avatar
🍵
Smashing the stacks

Renato Alencar renatoalencar

🍵
Smashing the stacks
View GitHub Profile
@renatoalencar
renatoalencar / example_atom.clj
Last active June 5, 2020 21:27
Introducao a Clojure Component
(ns example-atom
(:require [ring.adapter.jetty :refer [run-jetty]]
[monger.core :as mg]
[monger.collection :as mc]))
(def database (atom nil))
(defn connect-db! [uri]
(swap! database (fn [db] (-> uri
mg/connect-via-uri
async function findMostFrequent(array, blackListArr)
{
if(array.length == 0)
return null;
var modeMap = {};
var maxEl = array[0], maxCount = 1;
// First go through blackList array and set maxEl to the first element that isn't in the blacklist, if every of the numbers in the array is in the blacklist, then just return generateRandom
var containsValidNumbers = false;
const { createStore } = Redux;
/* Action creators */
function increment() {
return {
type: 'INCREMENT'
};
}
function decrement() {
function counter(state = 0, action) {
switch (action.type) {
case 'INCREMENT':
return state + 1;
case 'DECREMENT':
return state - 1;
default:
return state;
}
class AuthenticationService < ApplicationService
validates :user_present?,
I18n.t("devise.failure.invalid"),
Errors::AuthenticationError
validates :check_locked,
I18n.t("devise.failure.locked"),
Errors::AuthenticationError
validates :valid_credentials?,
class ApplicationService
class ServiceValidation
def initialize(opts = {})
@method = opts[:method]
@message = opts[:message]
@exception = opts.fetch(:exception, Errors::ServiceError)
end
def validate
unless yield @method
@renatoalencar
renatoalencar / test-angular-job.md
Last active October 11, 2017 13:35
Teste vaga Angular

Teste para vaga de desenvolvedor Angular

Você deverá criar uma aplicação Angular, para acessar a API pública https://jsonplaceholder.typicode.com/, além de:

  • Gerenciar o código usando Git
  • Usar testes automatizados
  • Customizar o layout com Sass
  • Integre comentários do Facebook com a sua aplicação