Skip to content

Instantly share code, notes, and snippets.

@aribeiro
aribeiro / README.md
Last active November 26, 2020 13:50
Fake API Call

Frontend Developer Interview

Task 1

Create a new React App using create-react-app: https://create-react-app.dev/

Task 2

  1. Copy the fakeAPI.js to the App created in Task 1, it will be representing the API you will need to use in order to get the data required for this current task.

  2. Create a Page that must to contain an input field and a button.

@aribeiro
aribeiro / displayContactsColumns.html
Last active July 26, 2017 18:02
CloudSponge Widget Reference - Display Phone Column and filter contacts with phone number
<!DOCTYPE html>
<html>
<body>
<!--
Include the script anywhere on your page, usually in the head
(don't forget to replace YOUR_WIDGET_SCRIPT with your CloudSponge key)
-->
<script src="//api.cloudsponge.com/widget/localhost-only.js"></script>
<script>
cloudsponge.init({
@aribeiro
aribeiro / skipContactsDisplay.html
Last active May 3, 2017 17:05
Cloudsponge Widget Reference - The skipContactsDisplay option with beforeDisplayContacts callback
<!DOCTYPE html>
<html>
<head>
<!--·
Include the script anywhere on your page, usually in the head
@aribeiro
aribeiro / ubuntu-install-ruby-1.8.7.sh
Created March 28, 2017 12:07 — forked from murphyslaw/ubuntu-install-ruby-1.8.7.sh
Install Ruby 1.8.7 with rbenv on Ubuntu
# Install system libraries.
sudo apt-get install zlib1g-dev openssl libssl-dev libreadline-dev git-core
# Install rbenv.
git clone git://github.com/sstephenson/rbenv.git ~/.rbenv
# Setup bash.
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
exec $SHELL
require "rest-client"
begin
exists = RestClient.head("http://google.com").code == 200
rescue RestClient::Exception => error
exists = (error.http_code != 404)
end
puts "exists=#{exists}"
@aribeiro
aribeiro / Ubuntu rbenv
Created March 3, 2012 19:37
Installing Ruby 1.9.2 with OpenSSL on Ubuntu 11.04 using ruby-build and rbenv
# for more info: https://gist.github.com/1120938
@aribeiro
aribeiro / default
Created February 29, 2012 12:53 — forked from mauricio/default
# as we’re going to use Unicorn as the application server
# we’re not going to use common sockets
# but Unix sockets for faster communication
upstream shop {
# fail_timeout=0 means we always retry an upstream even if it failed
# to return a good HTTP response (in case the Unicorn master nukes a
# single worker for timing out).
# for UNIX domain socket setups:
server unix:/tmp/shop.socket fail_timeout=0;
@aribeiro
aribeiro / default
Created February 29, 2012 12:53 — forked from mauricio/default
# as we’re going to use Unicorn as the application server
# we’re not going to use common sockets
# but Unix sockets for faster communication
upstream shop {
# fail_timeout=0 means we always retry an upstream even if it failed
# to return a good HTTP response (in case the Unicorn master nukes a
# single worker for timing out).
# for UNIX domain socket setups:
server unix:/tmp/shop.socket fail_timeout=0;
#!/usr/bin/env ruby
require 'rubygems'
require 'activesupport'
require 'chronic'
require 'optparse'
DAY_VALUE = 0 # regular value per day
WDAY_REGULAR = 1..5 # range for regular days 1..5 means from monday to friday
EXTRAS_VALUES = {
# First parameter is a bash printf formatting string
# From second till fifth parameter, rvm-prompt format parameters
__ruby_ps1 () {
if [ ! -f ./Rakefile ] &&
[ "$(find -maxdepth 1 -name '*.rb' | head -n1)" == "" ]; then
exit 1
fi
if [ -f ~/.rvm/bin/rvm-prompt ]; then
rst=$(~/.rvm/bin/rvm-prompt $2 $3 $4 $5)
fi