Skip to content

Instantly share code, notes, and snippets.

View fdocr's full-sized avatar
🤓

Fernando Valverde fdocr

🤓
View GitHub Profile
@mabenson00
mabenson00 / cheatsheet.rb
Last active June 19, 2024 23:44
Rails ActiveRecord JSON cheatsheet
# Basic key operators to query the JSON objects :
# #> : Get the JSON object at that path (if you need to do something fancy)
# -> : Get the JSON object at that path (if you don't)
# ->> : Get the JSON object at that path as text
# {obj, n} : Get the nth item in that object
# https://www.postgresql.org/docs/9.4/functions-json.html#FUNCTIONS-JSONB-OP-TABLE
# Date
# date before today
@mrmartineau
mrmartineau / stimulus.md
Last active May 12, 2024 04:35
Stimulus cheatsheet
@eparreno
eparreno / sidekiq_delete_jobs.md
Last active May 31, 2024 20:18
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
@ecerney
ecerney / gist:d6bfed963eede7c685a0
Last active February 23, 2017 11:03
Guard argument
/*
* For a more in depth look at the guard statement check out
* http://ericcerney.com/swift-guard-statement/
* where I build off the sample shown here.
*/
var x: Int? = 0
// Lets me unwrap x and also check a condition on it
func fooGuard() {
@anildigital
anildigital / gist:862675ec1b7bccabc311
Created July 26, 2014 18:27
Remove dangling docker images
docker rmi $(docker images -q -f dangling=true)
@bradmontgomery
bradmontgomery / install-comodo-ssl-cert-for-nginx.rst
Last active June 10, 2024 15:37
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

@coolaj86
coolaj86 / how-to-publish-to-npm.md
Last active June 9, 2024 23:19
How to publish packages to NPM

Getting Started with NPM (as a developer)

As easy as 1, 2, 3!

Updated:

  • Aug, 08, 2022 update config docs for npm 8+
  • Jul 27, 2021 add private scopes
  • Jul 22, 2021 add dist tags
  • Jun 20, 2021 update for --access=public
  • Sep 07, 2020 update docs for npm version