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
| import { Controller } from "stimulus" | |
| import { DirectUpload } from "@rails/activestorage" | |
| import Dropzone from "dropzone" | |
| import { getMetaValue, findElement, removeElement, insertAfter } from "helpers" | |
| Dropzone.autoDiscover = false | |
| export default class extends Controller { | |
| static targets = [ "input" ] |
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
| import * as React from "react"; | |
| import { useMousePosition } from "~/hooks/useMousePosition"; | |
| /** Component to cover the area between the mouse cursor and the sub-menu, to allow moving cursor to lower parts of sub-menu without the sub-menu disappearing. */ | |
| export function MouseSafeArea(props: { parentRef: React.RefObject<HTMLDivElement> }) { | |
| const { x = 0, y = 0, height: h = 0, width: w = 0 } = props.parentRef.current?.getBoundingClientRect() || {}; | |
| const [mouseX, mouseY] = useMousePosition(); | |
| const positions = { x, y, h, w, mouseX, mouseY }; | |
| return ( | |
| <div |
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 | |
| require 'octokit' | |
| # !!! DO NOT EVER USE HARD-CODED VALUES IN A REAL APP !!! | |
| login = ENV['GH_LOGIN'] | |
| password = ENV['GH_LOGIN_PASSWORD'] | |
| repo = "gjtorikian/crud-test" | |
| master = client.ref(repo, "heads/master") | |
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
| ### DigitalOcean Ubuntu 18.04 x64 + Rails 5 + Nginx + Unicorn + PostgreSQL9.6 + Capistrano 3 | |
| SSH into Root | |
| $ ssh [email protected] | |
| Change Root Password | |
| $ passwd |
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
| def result_handler(result) | |
| case result | |
| when Success, Some | |
| puts 'success, user created' | |
| when Failure { |message, _| message == :http_error } | |
| puts "HTTP request error, #{result.failure[2]}" | |
| when Failure { |message, _| message == :validation_error } | |
| puts "validation error, #{result.failure[2]}" | |
| when Failure(ROM::Error) | |
| puts 'User not created' |
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
| source 'https://rubygems.org' | |
| # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' | |
| gem 'rails', '4.0.3' | |
| gem 'sqlite3' | |
| gem "rmagick" | |
| gem "carrierwave" | |
| gem "fog" |
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
| # Caddyfile | |
| localhost:2015 { | |
| startup "go run ./server.go" & | |
| root ./static_files | |
| proxy / localhost:2016 | |
| } | |
| # FILE TREE | |
| # |