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 React from 'react'; | |
import ReactDOM from 'react-dom'; | |
export default class Portal extends React.Component { | |
root = null; | |
constructor(props) { | |
super(props); | |
this.el = document.createElement('div'); | |
} |
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
run.config: | |
extra_steps: | |
- "run locally" | |
- "run after app's runtime is built" | |
- "but before runtime is packaged for use" | |
- "Environment variables are not available during the build process." | |
- "No access to data services" | |
- "Code is fully writable" | |
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
version: 2 | |
jobs: | |
test-job: | |
machine: true | |
steps: | |
- checkout | |
- run: sudo bash -c "$(curl -fsSL https://s3.amazonaws.com/tools.nanobox.io/bootstrap/ci.sh)" | |
- run: nanobox evar add local CLOUDINARY_API_KEY=$CLOUDINARY_API_KEY |
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
require 'pry' | |
# Constants | |
INITIAL_MARKER = " " | |
PLAYER_MARKER = "X" | |
COMPUTER_MARKER = "O" | |
WINNING_LINES = [[1, 2, 3], [4, 5, 6], [7, 8, 9]] + # rows | |
[[1, 4, 7], [2, 5, 8], [3, 6, 9]] + # columns | |
[[1, 5, 9], [3, 5, 7]] # diagonals |
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
namespace :figaro do | |
desc "SCP transfer figaro configuration to the shared folder" | |
task :setup do | |
on roles(:app) do | |
upload! "config/application.yml", "#{shared_path}/config/application.yml", via: :scp | |
end | |
end | |
desc "Symlink application.yml to the release path" | |
task :symlink do |
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
# I wrote this script because I had a bunch of heroku apps on my account that I didn't know what | |
# local apps they matched. Just search the heroku app name and this script will find the local | |
# app for you. | |
# | |
# Feel free to use and alter this script as much as you want. | |
unless ARGV[0] | |
fail 'You pust provide repo name to search for' | |
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
require "net/http" | |
require "nokogiri" | |
unless [1, 2].include? ARGV.length | |
puts "Usage: TERM [max number of results to display]" | |
exit | |
end | |
def max_results | |
max = ARGV[1].to_i |
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
// choose a random number which is inclusively between min and max | |
chooseRandomBetween = function(min, max) { | |
var difference = Math.abs(max - min) + 1; | |
return Math.floor(Math.random() * difference) + Math.min(min, max); | |
} |
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
def balance_to_dollars(balance) | |
balance = "#{'%.2f' % balance}" | |
dollars = balance.split('.')[0] | |
cents = balance.split('.')[1] | |
dollars = dollars.reverse.gsub(/...(?=.)/,'\&,').reverse | |
"$#{dollars}.#{cents}" | |
end | |
print "What is your current age? " |