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
function Replace_Set() | |
{ | |
$replace = array( | |
'À' => 'A', 'Á' => 'A', 'Â' => 'A', 'Ã' => 'A', 'Ä' => 'Ae', | |
'Ä' => 'A', 'Å' => 'A', 'Ā' => 'A', 'Ą' => 'A', 'Ă' => 'A', | |
'Æ' => 'Ae', 'Ç' => 'C', 'Ć' => 'C', 'Č' => 'C', 'Ĉ' => 'C', | |
'Ċ' => 'C', 'Ď' => 'D', 'Đ' => 'D', 'Ð' => 'D', 'È' => 'E', | |
'É' => 'E', 'Ê' => 'E', 'Ë' => 'E', 'Ē' => 'E', 'Ę' => 'E', | |
'Ě' => 'E', 'Ĕ' => 'E', 'Ė' => 'E', 'Ĝ' => 'G', 'Ğ' => 'G', | |
'Ġ' => 'G', 'Ģ' => 'G', 'Ĥ' => 'H', 'Ħ' => 'H', 'Ì' => '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
FROM ruby:3.0.2 | |
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - | |
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list | |
RUN apt update | |
RUN apt install yarn -y | |
RUN apt install nano -y | |
RUN apt install nodejs -y | |
RUN apt install build-essential libpq-dev -y | |
RUN apt install postgresql-client -y |
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
#!/bin/sh | |
set -e | |
# if [ -f bundle check ]; then | |
bundle install | |
# fi | |
rm -f /app/tmp/pids/server.pid | |
exec "$@" |
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: '3' | |
services: | |
app: | |
build: . | |
container_name: fsapp | |
restart: unless-stopped | |
command: bundle exec rails s -p 3000 -b '0.0.0.0' | |
volumes: |
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
# Use Active Model has_secure_password | |
gem 'bcrypt', '~> 3.1.7' | |
# Reduces boot times through caching; required in config/boot.rb | |
gem 'bootsnap', '>= 1.4.4', require: false | |
# https://github.com/Netflix/fast_jsonapi | |
gem 'fast_jsonapi' | |
gem 'jwt' |
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
JOB_WORKER_URL=redis://redis:6379/0 |
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
const { innerWidth: width, innerHeight: height } = window; | |
console.log("Altura: " + window.innerHeight + ". Largura: " + window.innerWidth); |
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
default: &default | |
adapter: postgresql | |
encoding: unicode | |
# For details on connection pooling, see Rails configuration guide | |
# https://guides.rubyonrails.org/configuring.html#database-pooling | |
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> | |
development: | |
<<: *default | |
database: YourAppName_development |
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
.then(r => { | |
console.log(r) // { data: {content: here} } | |
}) | |
.catch(err => { | |
console.log(err.response.data.message) // { error: message } | |
console.log(err.response.status) // status code (as integer) | |
}) |
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
# app/lib/encryptor.rb | |
class Encryptor | |
def self.encrypt(unencrypted_string) | |
_cipher = OpenSSL::Cipher.new('AES-256-CBC').encrypt | |
_cipher.key = "AtafSyyodFgHwvbGNFtekoRKarGvMJlu" | |
if unencrypted_string.present? | |
encrypted_string = _cipher.update(unencrypted_string) + _cipher.final | |
Base64.encode64(encrypted_string.unpack('H*')[0].upcase).chomp |
OlderNewer