This file contains hidden or 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
upstream myhealthcare { | |
server 192.168.12.10:9292; | |
} | |
server { | |
listen 80; | |
try_files $uri @app; | |
location @app { |
This file contains hidden or 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
package main | |
import ( | |
"fmt" | |
"os" | |
) | |
func main() { | |
args := os.Args[1:] | |
name := args[0] |
This file contains hidden or 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 "benchmark" | |
Benchmark.bmbm do |x| | |
x.report("min") { (1..10000000).to_a.shuffle.min } | |
x.report("max") { (1..10000000).to_a.shuffle.max } | |
end | |
# Ruby 2.4-rc | |
user system total real | |
min 0.750000 0.000000 0.750000 ( 0.756316) | |
max 0.770000 0.020000 0.790000 ( 0.794998) |
This file contains hidden or 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
version: '2' | |
services: | |
moodle: | |
image: jhardison/moodle | |
links: | |
- moodle_db | |
environment: | |
MOODLE_URL: "http://0.0.0.0:8080" | |
DB_PORT_3306_TCP_ADDR: moodle_db | |
DB_ENV_MYSQL_USER: moodle |
This file contains hidden or 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 PlaylistCommentsHelper | |
def pinning_link(comment) | |
if comment.pinned? | |
unpin_link(comment) | |
else | |
pin_link(comment) | |
end | |
end | |
def unpin_link(comment) |
This file contains hidden or 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
00:00 git:wrapper | |
00:00 git:check | |
00:00 deploy:check:directories | |
00:00 deploy:check:linked_dirs | |
00:00 sidekiq:quiet | |
00:00 git:clone | |
00:00 git:update | |
00:00 git:create_release | |
00:00 deploy:set_current_revision | |
00:00 deploy:symlink:linked_dirs |
This file contains hidden or 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
lock '3.7.2' | |
set :application, 'my application' | |
set :repo_url, 'somethingsomething.git' | |
set :ssh_options, proxy: Net::SSH::Proxy::Command.new("ssh -W %h:%p -q root@proxy_server} -i {private_key_for_proxy} -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no") | |
# All your other configs... | |
# Note: -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no | |
# This can be potentially unsafe on an unknown network but is helpful for |
This file contains hidden or 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
class TestResultsController < ApplicationController | |
def index | |
@test_results = current_user.test_results | |
end | |
end |
This file contains hidden or 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
class User < ApplicationRecord | |
# ... | |
def test_results | |
# This API endpoint is slow. | |
HTTParty.get('https://someapi.com/test_results/user_id') | |
end | |
end |
This file contains hidden or 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
web_1 | I, [2017-07-11T14:01:06.771698 #11] INFO -- : Enqueued PreloadPatientRecordsJob (Job ID: ba184519-ccdb-4486-8c58-2cbe53b5abec) to Sidekiq(default) with arguments: #<GlobalID:0x007efe11a29890 @uri=#<URI::GID gid://myhealthcare/User/1>> | |
sidekiq_1 | 2017-07-11T14:01:08.087Z 1 TID-gs5hwxk04 PreloadPatientRecordsJob JID-d4d16a61150c753aed7c75be INFO: start | |
sidekiq_1 | D, [2017-07-11T14:01:10.062434 #1] DEBUG -- : Setting cache key: details. | |
sidekiq_1 | D, [2017-07-11T14:01:10.082970 #1] DEBUG -- : Setting cache key: observations. | |
sidekiq_1 | D, [2017-07-11T14:01:10.149937 #1] DEBUG -- : Setting cache key: conditions. | |
sidekiq_1 | D, [2017-07-11T14:01:10.172276 #1] DEBUG -- : Setting cache key: allergies. | |
sidekiq_1 | D, [2017-07-11T14:01:10.194290 #1] DEBUG -- : Setting cache key: immunizations. | |
sidekiq_1 | D, [2017-07-11T14:01:10.214040 #1] DEBUG -- : Setting cache key: all_medications. | |
sidekiq_1 | D, [2017-07-11T14:01:10.252209 #1] DEBUG -- : Setting cache |