I hereby claim:
- I am gin0606 on github.
- I am gin0606 (https://keybase.io/gin0606) on keybase.
- I have a public key ASAqSiNJbgMbQfYpX6kUWuwNBQ-8PB-dhyjlCPWBkjiKZgo
To claim this, I am signing this object:
# frozen_string_literal: true | |
require 'net/http' | |
require 'uri' | |
require 'json' | |
puts "CIRCLE_PULL_REQUEST: #{ENV['CIRCLE_PULL_REQUEST']}" | |
puts "CIRCLE_BRANCH: #{ENV['CIRCLE_BRANCH']}" | |
exit true if ENV['CIRCLE_PULL_REQUEST'].nil? |
def pr_url | |
uri_path = URI.parse(ENV['CI_PULL_REQUEST']).path.split('/') | |
"https://api.github.com/repos/#{uri_path[1]}/#{uri_path[2]}/pulls/#{uri_path[4]}" | |
end | |
def pr_title | |
require 'net/http' | |
require 'uri' | |
require 'json' |
let timestamp = "2017-07-03T17:00:00.000Z" | |
let formatter = DateFormatter() | |
formatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZ" | |
let date = formatter.date(from: timestamp)! | |
print(date) // => 2017-07-03 17:00:00 +0000 |
import React from 'react'; | |
import { createStore } from 'redux'; | |
import { Provider, connect } from 'react-redux'; | |
const View = props => ( | |
<div> | |
<p>{props.count}</p> | |
<button onClick={props.onClickIncrement}>+1</button> | |
<button onClick={props.onClickDecrement}>-1</button> | |
</div> |
I hereby claim:
To claim this, I am signing this object:
find . -name '*.rb' -type f -exec sh -c "tail -1 {} | xxd -p | tail -1 | grep -q -v 0a$" ';' -exec sh -c "echo >> {}" ';' |
module DateTimeRegex | |
module RFC3339 | |
class << self | |
def date_fullyear | |
/\d{4}/ | |
end | |
def date_month | |
/\d{2}/ | |
end |
RSpec.describe User do | |
describe 'POST /api/users' do | |
let(:access_token) { FactoryGirl.create(:access_token) } | |
let(:headers) do | |
{ | |
'Authorization' => "#{access_token.token_type} #{access_token.token}" | |
} | |
end | |
let(:params) do | |
{ |
RSpec.describe User do | |
context "with correct parameters" do | |
subject { build(:user) } | |
it { is_expected.to be_valid } | |
end | |
describe "User has properties" do | |
subject { build(:user) } | |
it { is_expected.to respond_to :screen_name } |
RSpec.describe User do | |
it "should be valid if it's the correct parameters" do | |
expect(build(:user)).to be_valid | |
end | |
context "when screen_name is not present" do | |
before { @user = build(:user, screen_name: "") } | |
it "should not be valid" do | |
expect(@user).not_to be_valid |