Prerequisites:
- Heroku CLI installed on your computer
- A project deployed to Heroku
| require 'sidekiq/api' | |
| # 1. Clear retry set | |
| Sidekiq::RetrySet.new.clear | |
| # 2. Clear scheduled jobs | |
| Sidekiq::ScheduledSet.new.clear |
| source 'https://rubygems.org' | |
| gem "graphql", github: "rmosolgo/graphql-ruby", branch: "subscriptions" | |
| gem "sinatra" | |
| gem "thin" |
| Suppose you have two heroku remote apps | |
| myapp-dev & myapp-prod | |
| and two git branches | |
| master(for dev) & production | |
| Now lets setup heroku on the existing git repo in your local machine | |
| Assuming the branches and the apps exist already | |
| git remote add heroku-myapp-dev https://git.heroku.com/myapp-dev.git | |
| git remote add heroku-myapp-prod https://git.heroku.com/myapp-prod.git | |
Prerequisites:
| # I was using https://github.com/maclover7/trix to do: | |
| # | |
| # f.input :my_input, as: :trix_editor | |
| # | |
| # Its currently been over two weeks since Rails 5.2 was released, and the | |
| # gem was the only thing preventing me from using it in multiple projects: | |
| # https://github.com/maclover7/trix/pull/61#issuecomment-384312659 | |
| # | |
| # So I made this custom simpleform input for my apps to prevent this from happening again in the future. | |
| # |
| #!/usr/bin/python3 | |
| import random | |
| import time | |
| row_count = 10000000 | |
| my_list = {random.randint(0, 2000): random.randint(0, 255) for i in range(row_count)} | |
| my_list2 = {random.randint(0, 2000): random.randint(0, 255) for i in range(row_count)} |
Efeito ondulação com :hover.
A Pen by Bruno Nepomuceno on CodePen.
This is a collection of the things I believe about software development. I have worked for years building backend and data processing systems, so read the below within that context.
Agree? Disagree? Feel free to let me know at @JanStette.
Keep it simple, stupid. You ain't gonna need it.
| const Twitter = require('twitter') | |
| const fs = require('fs') | |
| const client = new Twitter({ | |
| consumer_key: '', | |
| consumer_secret: '', | |
| access_token_key: '', | |
| access_token_secret: '', | |
| }) |
This is just some code I recently used in my development application in order to add token-based authentication for my api-only rails app. The api-client was to be consumed by a mobile application, so I needed an authentication solution that would keep the user logged in indefinetly and the only way to do this was either using refresh tokens or sliding sessions.
I also needed a way to both blacklist and whitelist tokens based on a unique identifier (jti)
Before trying it out DIY, I considered using: