Skip to content

Instantly share code, notes, and snippets.

@artisr
artisr / !README.MD
Created June 14, 2022 19:34 — forked from davideluque/!README.MD
Sign in with Apple in Ruby on Rails using apple_id gem.

Implementation of the Sign in with Apple service in Ruby on Rails. This implementation is convenient for Ruby on Rails APIs as it does not use views.

This implementation does:

  • Verify the user's identity token with apple servers to confirm that the token is not expired and ensure it has not been tampered with or replayed to the app.
  • Log in the user, register the user or connect the user's apple account to the user's existing account.

Parameters

  • code: Apple's authorizationCode after sign in. Example: c49a75458b1e74b9f8e866f5a93b1689a.0.nrtuy. ...
@artisr
artisr / 0_backup_server.md
Last active April 16, 2022 08:46 — forked from francois-blanchard/0_backup_server.md
Backup server with gem Backup and Whenever

Backup server with gem Backup and Whenever

sudo apt-get install build-essential libcurl4-openssl-dev sudo apt-get install libxml2-dev

Config Backup

Install backup gem

$ gem install backup
test:
-
- 'Α'
- d1
-
- 'α'
- d1
-
- 'Β'
- d12
test:
-
- 'А'
- d1
-
- 'а'
- d1
-
- 'Б'
- d12
test:
-
- 'А'
- d1
-
- 'а'
- d1
-
- 'Ā'
- d16
tests:
-
- '^'
- d46
-
- '#'
- d3456
-
- '_'
- d6
@artisr
artisr / lv.test.yaml
Last active September 17, 2018 11:56
# comments start with '#' anywhere on a line
# first define which tables will be used for your tests
table: [unicode.dis, Lv-Lv-g1.utb]
# then optionally define flags such as testmode. If no flags are
# defined forward translation is assumed
# now define the tests
tests:
# character tests
@artisr
artisr / ssl_puma.sh
Created August 8, 2018 14:39 — forked from tadast/ssl_puma.sh
localhost SSL with puma
# 1) Create your private key (any password will do, we remove it below)
$ cd ~/.ssh
$ openssl genrsa -des3 -out server.orig.key 2048
# 2) Remove the password
$ openssl rsa -in server.orig.key -out server.key
@artisr
artisr / tutorial.md
Created July 17, 2018 11:25 — forked from swalkinshaw/tutorial.md
Designing a GraphQL API

Tutorial: Designing a GraphQL API

This tutorial was created by Shopify for internal purposes. We've created a public version of it since we think it's useful to anyone creating a GraphQL API.

It's based on lessons learned from creating and evolving production schemas at Shopify over almost 3 years. The tutorial has evolved and will continue to change in the future so nothing is set in stone.

@artisr
artisr / sidekiq_delete_jobs.md
Created June 14, 2018 20:27 — forked from eparreno/sidekiq_delete_jobs.md
How to delete Sidekiq jobs in a Rails app using ActiveJobs

How to delete Sidekiq jobs in a Rails app using ActiveJobs

Sidekiq jobs can be enqueued or scheduled. Enqueued means that they are gonna be picked up as soon as possible, scheduled jobs will be enqueued at some specific time.

job_id and jid

When using ActiveJobs, Rails will return a job_id after sending the job to ActiveJobs

job = UserMailer.send_invite(params).deliver_later