- Getting Real -> http://www.amazon.com/Getting-Real-Jason-Fried-ebook/dp/B0053KHGWM/ref=sr_1_2?ie=UTF8&qid=1417434564&sr=8-2&keywords=getting+real
- Rework -> https://37signals.com/rework
- The Pragmatic Programmer: From Journeyman to Master -> http://www.amazon.com/The-Pragmatic-Programmer-Journeyman-Master/dp/020161622X/ref=pd_sim_b_40?ie=UTF8&refRID=1C5QKVRR1RC45BRTRBFA
- Refactoring: Improving the Design of Existing Code -> http://www.amazon.com/gp/product/0201485672/ref=s9_psimh_gw_p14_d12_i4?pf_rd_m=ATVPDKIKX0DER&pf_rd_s=desktop-2&pf_rd_r=13XTHB4RKQ3H35TH2BZX&pf_rd_t=36701&pf_rd_p=1970567562&pf_rd_i=desktop
- Working Effectively with Legacy Code -> http://www.amazon.com/Working-Effectively-Legacy-Michael-Feathers/dp/0131177052/ref=pd_sim_b_3?ie=UTF8&refRID=0NFDX09AB5N8Y6EM4BB5
- Extreme Programming Explained: Embrace Change, 2nd Edition (The XP Series) -> http://www.amazon.com/Extreme-Programming-Explained-Embrace-Edition/dp/0321278658/ref=pd_sim_b_16?i
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
// This Gist doesn't work with Graphql because of the deep nature of "selections" object | |
import { get } from 'lodash' | |
const memoizedResults = {} | |
export default (serializer: string, fn: Function): Function => async ( | |
...args: Array<any> | |
): Promise<Object> => { | |
const [serializable, selections] = args | |
const identifier = get(serializable, 'id', get(serializable, 'uid')) |
- Nodejs -> https://nodejs.org/en/
- Typescript -> https://www.typescriptlang.org/
- Express -> http://expressjs.com/pt-br/
- Angular -> https://angularjs.org/
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
// Option 1 | |
@defining( | |
(for { | |
custo <- cotacaoItem.custo | |
aliquotaSts <- custo.custoIcms.percentualAliquota | |
aliquotaFornecedor <- cotacaoItem.produto.percentualAliquotaIcms | |
cssClass <- if (aliquotaFornecedor.equals(aliquotaSts)) {Some("")} else {None} | |
} yield { cssClass }) getOrElse { "red" } | |
) { cssClass => |
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
org.springframework.web.client.ResourceAccessException: I/O error on POST request for "https://gcm-http.googleapis.com/gcm/send":Connection timed out; nested exception is java.net.ConnectException: Connection timed out | |
at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:580) | |
at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:530) | |
at org.springframework.web.client.RestTemplate.postForObject(RestTemplate.java:330) | |
at com.unicred.message.MessageService.sendMessage(MessageService.java:37) | |
at com.unicred.router.MessageRouter.sendToUser(MessageRouter.java:90) | |
at com.unicred.router.MessageRouter.route(MessageRouter.java:48) | |
at com.unicred.receiver.Receiver.receiveMessage(Receiver.java:27) | |
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) | |
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) |
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
{ | |
"nodes":[ | |
{ | |
"id":12105, | |
"name":"ALICANTE04:PING", | |
"type":"IC", | |
"level":"" | |
}, | |
{ | |
"id":12115, |
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 'nokogiri' | |
class String | |
def underscore | |
self.gsub(/::/, '/'). | |
gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2'). | |
gsub(/([a-z\d])([A-Z])/,'\1_\2'). | |
tr("-", "_"). | |
downcase | |
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 remove_tuples_from(string) | |
string.gsub! ' ', '' | |
string.gsub! /\(\)|[\,]?\([\d]*((\d\,)*\d)*\)|\(\)|\([\d]*((\d\,)*\d)*\)[\,]+|\(\)|\([\d]*((\d\,)*\d)*\)/x, '' | |
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
# 1. Transaction Fee Caculation | |
# We have a ladder fee structure. Please write a function to calculate total transaction fee we can get given the trading volume. | |
# Volume Fee | |
# 0 - 10 btc 2% | |
# 10 - 50 btc 1% | |
# 50 - 100 btc 0.5% | |
# 100 - 1000 btc 0.25% | |
# 1000 - 5000 btc 0.1% |
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 'rspec' | |
require './transaction_fee_calculation' | |
describe 'calculation' do | |
it "tax should be 0.1 for 5 Bitcoins" do | |
expect(FeeCalculator.for(5)).to eq(0.1) | |
end | |
it "tax should be 0.2 for 10 Bitcoins" do | |
expect(FeeCalculator.for(10)).to eq(0.2) |
NewerOlder