ActionParameter helps you move all your parameter's logic into it's own class. This way you'll keep your controllers dry and they would be easier to test.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| LOADING=false | |
| usage() | |
| { | |
| cat << EOF | |
| usage: $0 [options] dbname | |
| OPTIONS: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # inspired by http://ariejan.net/2010/08/23/resque-how-to-requeue-failed-jobs | |
| # retry all failed Resque jobs except the ones that have already been retried | |
| # This is, for instance, useful if you have already retried some jobs via the web interface. | |
| Resque::Failure.count.times do |i| | |
| Resque::Failure.requeue(i) unless Resque::Failure.all(i, 1)['retried_at'].present? | |
| end | |
| # retry all :) | |
| Resque::Failure.count.times do |i| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #spec/supports/custom_matchers.rb | |
| RSpec::Matchers.define :be_json do |expected| | |
| match do |actual| | |
| actual = ActiveSupport::JSON.decode(actual).with_indifferent_access | |
| expected = ActiveSupport::JSON.decode(expected) unless expected.is_a?(Hash) | |
| expected = expected.with_indifferent_access | |
| actual.diff(expected) == {} | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # app/models/user.rb | |
| class User < ActiveRecord::Base | |
| validates :zip_code, presence: true, zip_code: true | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "response": { | |
| "status": 1000, | |
| "transaction_id": "668484", | |
| "message": { | |
| "card": { | |
| "id": "35449959", | |
| "activated": "1", | |
| "activation_code": null, | |
| "expiration_date": "2017-09-30", |
I’m looking for any tips or tricks for making chrome headless mode less detectable. Here is what I’ve done so far:
Set my args as follows:
const run = (async () => {
const args = [
'--no-sandbox',
'--disable-setuid-sandbox',
'--disable-infobars',
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| version: '3.7' | |
| services: | |
| ubuntu: | |
| image: ubuntu:18.04 | |
| volumes: | |
| - .:/curso | |
| working_dir: /curso |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //CLIENT | |
| Gun.on('opt', function (ctx) { | |
| if (ctx.once) { | |
| return | |
| } | |
| this.to.next(ctx) | |
| ctx.on('auth', function(msg){ | |
| let to = this.to | |
| clientAuth(ctx) | |
| function clientAuth(ctx){ |