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
| #!/bin/bash | |
| set -euo pipefail | |
| if [ "$#" -lt 1 ]; then | |
| echo "usage: $0 password" >&2 | |
| exit | |
| fi | |
| SALT=$(head -c 18 /dev/urandom | base64 | tr -d '\n') |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>RC Scout + React example</title> | |
| <script src="https://unpkg.com/babel-standalone@6/babel.min.js"></script> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/react/16.1.0/umd/react.production.min.js"></script> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/react-dom/16.1.0/umd/react-dom.production.min.js"></script> | |
| <script type="text/babel"> | |
| // From https://gist.github.com/davidbalbert/44f7f3329c2bcbc5b5bee2d4b93a8253 |
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 RCScout extends React.Component { | |
| rerenderScout() { | |
| if (window._rcs && window._rcs.inst) { | |
| window._rcs.inst.render(); | |
| } | |
| } | |
| componentDidMount() { | |
| this.rerenderScout(); | |
| } |
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
| # frozen_string_literal: true | |
| begin | |
| require "bundler/inline" | |
| rescue LoadError => e | |
| $stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler" | |
| raise e | |
| end | |
| gemfile(true) do |
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
| for (var i = 0; i < 10; i++) {} | |
| i // => 10 | |
| for (let j = 0; j < 10; j++) {} | |
| j // Uncaught ReferenceError: j is not defined |
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
| function range(start, stop, step = 1) { | |
| if (Math.sign(stop-start) !== Math.sign(step) || step === 0) { | |
| return []; | |
| } | |
| let nums = []; | |
| if (step > 0) { | |
| for (let i = start; i <= stop; i += step) { | |
| nums.push(i); |
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
| 2017-07-19T15:05:45.358048+00:00 app[web.4]: ActionController::RoutingError (No route matches [POST] "/api/v1/token"): | |
| 2017-07-19T15:05:45.358050+00:00 app[web.4]: vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.7.1/lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call' | |
| 2017-07-19T15:05:45.358050+00:00 app[web.4]: vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.14.1.311/lib/new_relic/agent/instrumentation/middleware_tracing.rb:79:in `call' | |
| 2017-07-19T15:05:45.358051+00:00 app[web.4]: vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.7.1/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call' | |
| 2017-07-19T15:05:45.358052+00:00 app[web.4]: vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.14.1.311/lib/new_relic/agent/instrumentation/middleware_tracing.rb:79:in `call' | |
| 2017-07-19T15:05:45.358053+00:00 app[web.4]: vendor/bundle/ruby/2.3.0/gems/railties-4.2.7.1/lib/rails/rack/logger.rb:38:in `call_app' | |
| 2017-07-19T15:05:45.358053+00:00 app[web.4]: vendor/bundle/ruby/2.3.0/gems/railties-4.2.7.1/lib/rails/ra |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>React Scout test</title> | |
| <script src="https://unpkg.com/babel-standalone@6/babel.min.js"></script> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.6.1/react.js"></script> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.6.1/react-dom.js"></script> | |
| </head> | |
| <body> |
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
| #!/usr/bin/env ruby | |
| # | |
| # Converts an RSA public key from PKCS#8 format to PKCS#1 format. This is useful if you don't have OpenSSL 1.1 | |
| # See https://stackoverflow.com/questions/18039401/how-can-i-transform-between-the-two-styles-of-public-key-format-one-begin-rsa | |
| key = STDIN.read | |
| lines = key.split("\n") | |
| only_key = lines[1..-2].join("") | |
| without_header = only_key[32..-1] |
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 Memoize | |
| def memoize(name) | |
| m = Module.new do | |
| define_method name do |*args| | |
| return instance_variable_get("@_#{name}") if instance_variable_defined? "@_#{name}" | |
| instance_variable_set("@_#{name}", super(*args)) | |
| end | |
| end | |