This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
language: ruby | |
sudo: required | |
dist: trusty | |
services: | |
- docker | |
script: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def transfer | |
amount = params[:amount] | |
Wallet.transaction do | |
@client1.withdrawal(amount) | |
@client2.deposit(amount) | |
end | |
render status: :ok | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def transfer | |
amount = params[:amount] | |
@client1.withdrawal(amount) | |
@client2.deposit(amount) | |
render status: :ok | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Persistence | |
module Commands | |
class CreateUserCompany < ROM::Commands::Create[:sql] | |
input Dry::Data['hash'].schema( | |
user_id: 'int', | |
company_id: 'int' | |
) | |
relation :user_company | |
register_as :create |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'equalizer' | |
require 'dry/data' | |
module Entities | |
class Friend < Dry::Data::Struct | |
include Equalizer.new(:id, :source_id, :target_id) | |
attribute :id, 'int' | |
attribute :source_id, 'int' | |
attribute :target_id, 'int' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# ANAGRAM GENERATOR | |
# | |
# Author: Mauricio Klein (mauricio [dot] klein [dot] msk [at] gmail [dot] com) | |
# Date: October 6th, 2016 | |
# | |
# | |
# USAGE: | |
# $ ruby anagram.rb <a word> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import {Route, Redirect} from 'react-router'; | |
import { | |
App, | |
NotFound, | |
Panel | |
} from 'containers'; | |
export default () => { | |
return ( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
api: | |
image: ruby | |
links: | |
- db | |
ports: | |
- "3000:3000" | |
db: | |
image: postgres |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import request from 'superagent'; | |
export const getWeatherForCity = (city, country) => { | |
return new Promise((resolve, reject) => { | |
request | |
.get('http://api.openweathermap.org/data/2.5/weather') | |
.query({ | |
q: `${city},${country}`, | |
units: 'metric', | |
APPID: 'ABC123' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"action": "talk", | |
"text": "Hello! This is an automated call from ACME company.", | |
"voiceName": "Brian", | |
"bargeIn": false | |
}, | |
{ | |
"action": "talk", | |
"text": "Please confirm the service request for Max Mustermann, PNR: B, C, X, 4, 5, 1, 3.", |
OlderNewer