- Go installed on your system
- Your OpenAPI specification file (openapi.yaml)
github.com/getkin/kin-openapifor parsing OpenAPI specsgithub.com/labstack/echo/v4as a lightweight web framework- Standard Go libraries for file handling and HTTP operations
github.com/getkin/kin-openapi for parsing OpenAPI specsgithub.com/labstack/echo/v4 as a lightweight web framework| #!/bin/bash | |
| # deploy.sh | |
| # Put this script on your production server and make it executable with chmod | |
| # +x. | |
| # Set the deploy_dir variable to the path on the production server to | |
| # deployment directory. The script assumes the deployment directory is a git | |
| # clone of the codebase from an upstream git repo. This script also assumes |
| #!/usr/bin/env bash | |
| # Configuration | |
| SERVER='10.20.30.40' | |
| DEPLOY_TO='/Users/simon/apps/some_app/staging/' | |
| EXCLUDE='*.sqlite3 *.swp .DS_Store .git/ tmp/ log/ public/uploads/ uploads/' | |
| DRY_RUN=false | |
| DEPLOY_GEM_PATH='/Users/simon/.rvm/gems/ruby-1.9.2-p180' | |
| MYSQL2_BUNDLE='/Users/simon/apps/some_app/staging/vendor/bundle/ruby/1.9.1/gems/mysql2-0.2.13/lib/mysql2/mysql2.bundle' |
| def lookup_hash | |
| h = {} | |
| letter = 'a' | |
| count = 1 | |
| for i in (1..26) | |
| h[letter] = count | |
| letter = letter.next | |
| count += 1 | |
| end | |
| h |
| =begin | |
| =end | |
| def lookup_hash | |
| h = {} | |
| letter = 'a' | |
| count = 1 | |
| for i in (1..26) | |
| h[letter] = count |
| require 'aws-sdk-s3' # v2: require 'aws-sdk' | |
| ACCESS_KEY_ID = "" | |
| SECRET_ACCESS_KEY = "" | |
| REGION_ID = "us-east-1" | |
| BUCKET_NAME = "bucket-name" | |
| def uploadS3 | |
| credentials = Aws::Credentials.new( | |
| ACCESS_KEY_ID, |
| # Definition for a binary tree node. | |
| # class TreeNode | |
| # attr_accessor :val, :left, :right | |
| # def initialize(val = 0, left = nil, right = nil) | |
| # @val = val | |
| # @left = left | |
| # @right = right | |
| # end | |
| # end |
| from collections import defaultdict | |
| import heapq | |
| class Solution: | |
| def maxProbability(self, n: int, edges: List[List[int]], succProb: List[float], start: int, end: int) -> float: | |
| ''' | |
| Input | |
| n - number of nodes | |
| edges - (u,v) for an undirected edge. | |
| succProb - edge[i]'s weight | |
| start - start node |
| class Solution { | |
| public int change(int amount, int[] coins) { | |
| int[][] dp = new int[coins.length + 1][amount + 1]; | |
| dp[0][0] = 1; | |
| for (int j = 1; j <= coins.length; j++) { | |
| dp[j][0] = 1; // number ways of selecting for amount zero is 1 | |
| for (int i = 1; i <= amount; i++) { | |
| dp[j][i] = dp[j - 1][i]; // exclude current coin | |
| if (i - coins[j - 1] >= 0) { // check if amount >= to the current i`th coin | |
| dp[j][i] += dp[j][i - coins[j - 1]]; // include current coin |
| # Definition for singly-linked list. https://leetcode.com/problems/partition-list/submissions/ | |
| # class ListNode | |
| # attr_accessor :val, :next | |
| # def initialize(val = 0, _next = nil) | |
| # @val = val | |
| # @next = _next | |
| # end | |
| # end | |
| # @param {ListNode} head | |
| # @param {Integer} x |