# docker/webapp/Dockerfile
FROM ruby:2.6.6
SHELL ["/bin/bash", "-c"]
RUN apt-get update -qq && apt-get install -y postgresql-client memcached tzdata nano
# Install node 12, yarn
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash -
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
View create_spec.rb
# Example Request | |
# My Devise model is named Merchant | |
# Key lines to note are 16, 21, 27, 28, 29 | |
require 'rails_helper' | |
RSpec.describe 'POST /api/v2/customer_groups', type: :request do | |
let(:merchant) { FactoryGirl.create(:merchant) } | |
let(:user) { FactoryGirl.create(:user) } | |
let(:customer) { merchant.customers.create(user_id: user.id)} | |
let(:params) {{ |
View rails-docker-compose.md
View sitemap.xml
--- | |
layout: false | |
permalink: "/sitemap.xml" | |
--- | |
<?xml version="1.0" encoding="UTF-8"?> | |
<urlset xmlns="https://www.sitemaps.org/schemas/sitemap/0.9"> | |
<url> | |
<loc>https://tilishop.com/</loc> | |
</url> | |
<url> |
View README.md
Questions:
- Can we avoid installing Discourse as root? Cf. https://meta.discourse.org/t/install-issues-when-not-root/16538/17
How to install Discourse 2.4+ on Dokku (2019)
Discourse is very clear that they do not support anything else than their official install instructions, which more or less requires a dedicated server.
View gist:6352742
// svg.textflow.js 0.8 - Copyright (c) 2013 Wout Fierens - Licensed under the MIT license | |
SVG.Textflow = function() { | |
this.constructor.call(this, SVG.create('text')) | |
/* define default style */ | |
this.styles = { | |
'font-size': 16 | |
, 'font-family': 'Helvetica, Arial, sans-serif' | |
, 'text-anchor': 'start' |
View payconiq-jwk-to-pem.rb
require 'jose' | |
require 'faraday' | |
require 'fast_jsonparser' | |
endpoint = 'https://ext.payconiq.com/certificates' | |
kid = 'es.signature.ext.payconiq.com' | |
response = Faraday.get(endpoint, {}, { 'Accept' => 'application/json' }) | |
keys = FastJsonparser.parse(response.body).dig(:keys) |
View Ruby OpenSSL: Verify Signature Example.rb
require 'openssl' | |
def verify_sign(key, signature, data) | |
# Verifies with a public key that the data was signed with their private key | |
pubkey = key.public_key | |
if pubkey.verify(OpenSSL::Digest::SHA256.new, signature, data) | |
puts 'the signature is valid' | |
else | |
puts 'the signature is invalid' | |
end | |
end |
View Ruby OpenSSL: Verify Signature Example.rb
require 'openssl' | |
def verify_sign(key, signature, data) | |
# Verifies with a public key that the data was signed with their private key | |
pubkey = key.public_key | |
if pubkey.verify(OpenSSL::Digest::SHA256.new, signature, data) | |
puts 'the signature is valid' | |
else | |
puts 'the signature is invalid' | |
end | |
end |
View prefetch.js
const hoverTime = 400 | |
const fetchers = {} | |
const doc = document.implementation.createHTMLDocument('prefetch') | |
function fetchPage (url, success) { | |
const xhr = new XMLHttpRequest() | |
xhr.open('GET', url) | |
xhr.setRequestHeader('VND.PREFETCH', 'true') | |
xhr.setRequestHeader('Accept', 'text/html') | |
xhr.onreadystatechange = () => { |
View elementary OS AppCenter debug
** (process:2152): DEBUG: 08:43:35.748: ScreenshotCache.vala:18: screenshot path is at /home/wout/.cache/io.elementary.appcenter/screenshots | |
(io.elementary.appcenter:2152): Gtk-DEBUG: 08:43:35.790: Connecting to session manager | |
** (io.elementary.appcenter:2152): DEBUG: 08:43:35.794: Client.vala:114: update cache called false | |
** (io.elementary.appcenter:2152): DEBUG: 08:43:35.794: Client.vala:161: Too soon to refresh and not forced | |
(io.elementary.appcenter:2152): PackageKit-DEBUG: 08:43:35.795: notify::connected | |
(io.elementary.appcenter:2152): PackageKit-DEBUG: 08:43:35.821: notify::connected | |
** (io.elementary.appcenter:2152): DEBUG: 08:43:35.822: Opening cache file: /home/wout/.cache/appstream-cache-YJJIK0.mdb | |
** (io.elementary.appcenter:2152): DEBUG: 08:43:35.823: Added /usr/share/app-info/yaml to YAML metadata search path. | |
** (io.elementary.appcenter:2152): DEBUG: 08:43:35.823: Added /var/lib/app-info/yaml to YAML metadata search path. |
NewerOlder