- What/Why JSON schema
- Apply to rails model validation
- Test your API endpoint with schema matcher
- Homework for a curious reader
- References
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 { createContext, useRef, useState } from 'react' | |
export const PyodideContext = createContext() | |
export default function PyodideProvider({ children }) { | |
const pyodide = useRef(null) | |
const hasLoadPyodideBeenCalled = useRef(false) | |
const [isPyodideLoading, setIsPyodideLoading] = useState(true) | |
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
# <type>: (If applied, this commit will...) <subject> (Max 50 char) | |
# |<---- Using a Maximum Of 50 Characters ---->| | |
# Explain why this change is being made | |
# |<---- Try To Limit Each Line to a Maximum Of 72 Characters ---->| | |
# Provide links or keys to any relevant tickets, articles or other resources | |
# Example: Github issue #23 |
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
# spec/controllers/api_clients_controller_spec.rb | |
RSpec.describe APIClientsController, type: :controller do | |
let(:api_client) { mock_model(APIClient) } | |
context "when HTTP Digest auth credentials are invalid" do | |
before do | |
authenticate_with_http_digest("invalid_login", "invalid_password") do | |
get :index | |
end | |
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
/* AngularJS string.Format filter | |
* | |
* This filter provides string variable replacement similar to C# string.Format("{0}", "something"); | |
* | |
* Usage: {{ "From model: {0}; and a constant: {1};" | format:model.property:"constant":...:... }} | |
*/ | |
(function (angular) { | |
angular |
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
#!/usr/bin/env ruby | |
# | |
# When run against rails/rails commit 91684fb193a91671d682701cc1357e7b4b3fbe2b, | |
# this code produces the following output on my machine: | |
# | |
# long start @ 0.000 | |
# short start @ 0.510 | |
# short finish @ 1.511 | |
# short reported 1.511186 s |
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
RSpec::Matchers.define :be_monotonically_increasing do | |
match do |actual| | |
derivative = actual.each_cons(2).map{|x, y| y <=> x} | |
derivative.all?{|v| v >= 0} | |
end | |
failure_message_for_should do |actual| | |
"expected array #{actual.inspect} to be monotonically increasing" | |
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
--- | |
language: objective-c | |
before_script: | |
- ./scripts/travis/add-key.sh | |
after_script: | |
- ./scripts/travis/remove-key.sh | |
after_success: | |
- ./scripts/travis/testflight.sh | |
env: | |
global: |
NewerOlder