- Generate new rails app using
--webpackflag
rails new myApp --webpack=vueNote:
- You can use
--webpack=angularfor angular application and--webpack=reactfor react.
| FROM ruby:2.7.0-slim | |
| MAINTAINER Greg | |
| RUN apt-get update && apt-get upgrade -y && \ | |
| apt-get install -y --no-install-recommends tzdata default-libmysqlclient-dev \ | |
| build-essential sudo git curl ssh openssh-client && \ | |
| sudo apt-get install -y nodejs yarn && \ | |
| apt-get clean autoclean && \ | |
| apt-get purge -y --auto-remove && \ |
| { | |
| "cities": [ | |
| { | |
| "name": "Taipei City", | |
| "code": 100, | |
| "region": [ | |
| { "name": "Zhongshan District", "code": 104 }, | |
| { "name": "Da-an District", "code": 106 }, | |
| { "name": "Xinyi District", "code": 110 }, | |
| { "name": "Neihu District", "code": 114 }, |
ssh-bot channelsudo vim /etc/ssh/scripts/notify.sh#!/bin/sh
url="SLACK_WEBHOOK_URL"
| require 'base64' | |
| require 'digest' | |
| require 'openssl' | |
| module AESCrypt | |
| def AESCrypt.encrypt(password, iv, cleardata) | |
| cipher = OpenSSL::Cipher.new('AES-256-CBC') | |
| cipher.encrypt # set cipher to be encryption mode | |
| cipher.key = password |
| require "openssl" | |
| require "digest" | |
| def aes128_cbc_encrypt(key, data, iv) | |
| key = Digest::MD5.digest(key) if(key.kind_of?(String) && 16 != key.bytesize) | |
| iv = Digest::MD5.digest(iv) if(iv.kind_of?(String) && 16 != iv.bytesize) | |
| aes = OpenSSL::Cipher.new('AES-128-CBC') | |
| aes.encrypt | |
| aes.key = key | |
| aes.iv = iv |
| #These are the steps required in order to Install ImageMagick with JPG, PNG and TIFF delegates. | |
| sudo apt-get update | |
| #Install Build-Essential in order to configure and make the final Install | |
| sudo apt-get install build-essential | |
| #libjpg62-dev required in order to work with basic JPG files |
| stats = Sidekiq::Stats.new | |
| stats.queues | |
| stats.enqueued | |
| stats.processed | |
| stats.failed |
| -- Based off IETF draft, https://datatracker.ietf.org/doc/draft-peabody-dispatch-new-uuid-format/ | |
| create or replace function uuid_generate_v7() | |
| returns uuid | |
| as $$ | |
| begin | |
| -- use random v4 uuid as starting point (which has the same variant we need) | |
| -- then overlay timestamp | |
| -- then set version 7 by flipping the 2 and 1 bit in the version 4 string | |
| return encode( |