Skip to content

Instantly share code, notes, and snippets.

describe('MetricDisplay', () => {
given('value', () => '100');
beforeEach(() => {
render(<MetricDisplay value={given.value} />);
});
it('renders metric value', () => {
expect(screen.getByText('100')).toBeVisible();
});
@bruno-campos
bruno-campos / autoresize.ts
Last active August 22, 2018 14:23 — forked from maxt3r/autoresize.ts
Ionic 2 ion-textarea autoresize
// An autoresize directive that works with ion-textarea in Ionic 2
// Usage example: <ion-textarea autoresize [(ngModel)]="body"></ion-textarea>
// Based on https://www.npmjs.com/package/angular2-autosize
import { Directive, HostListener, ElementRef, Input } from '@angular/core';
@Directive({
selector: 'ion-textarea[autoresize]'
})
export class AutoresizeDirective {
@bruno-campos
bruno-campos / deploy.rb
Last active December 21, 2015 13:39
Files to configure puma + nginx for simple rails deployment. Put them under config folder.
require "bundler/capistrano"
require "puma/capistrano"
server "<server_ip>", :web, :app, :db, primary: true
set :application, "<app_name>"
set :user, "deployer"
set :deploy_to, "/home/#{user}/apps/#{application}"
set :deploy_via, :remote_cache
set :use_sudo, false
@bruno-campos
bruno-campos / deploy.rb
Last active December 21, 2015 10:49
deploy.rb example file. Credits to Ryan Bates: https://github.com/railscasts/335-deploying-to-a-vps/
require "bundler/capistrano"
server "YOUR_SERVER_IP", :web, :app, :db, primary: true
set :application, "<app_name>"
set :user, "deployer"
set :deploy_to, "/home/#{user}/apps/#{application}"
set :deploy_via, :remote_cache
set :use_sudo, false
@bruno-campos
bruno-campos / nginx.conf
Last active December 21, 2015 10:49
Files to configure unicorn + nginx for simple rails deployment. Put them under config folder. Credits to Ryan Bates: https://github.com/railscasts/335-deploying-to-a-vps/
upstream unicorn {
server unix:/tmp/unicorn.<app_name>.sock fail_timeout=0;
}
server {
listen 80 default deferred;
# server_name example.com;
root /home/deployer/apps/<app_name>/current/public;
location ^~ /assets/ {
@bruno-campos
bruno-campos / composer.rb
Last active December 20, 2015 21:59
Rails composer script without ruby version
# >---------------------------------------------------------------------------<
#
# _____ _ _
# | __ \ (_) | /\
# | |__) |__ _ _| |___ / \ _ __ _ __ ___
# | _ // _` | | / __| / /\ \ | '_ \| '_ \/ __|
# | | \ \ (_| | | \__ \/ ____ \| |_) | |_) \__ \
# |_| \_\__,_|_|_|___/_/ \_\ .__/| .__/|___/
# | | | |
# |_| |_|