Skip to content

Instantly share code, notes, and snippets.

View chebyte's full-sized avatar
🤡
smile

maurotorres chebyte

🤡
smile
View GitHub Profile
const path = require('path');
const express = require('express');
const Gun = require('gun');
require('gun/nts')
const port = (process.env.PORT || 8080);
const app = express();
app.use(Gun.serve);
@chebyte
chebyte / GunDBpermissionExample.js
Created October 16, 2020 15:03 — forked from ThinkingJoules/GunDBpermissionExample.js
GunDB group permissions example. Restrict reads and/or writes.
//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){
@chebyte
chebyte / docker-compose.yaml
Created August 19, 2020 14:23
Docker for ubuntu
version: '3.7'
services:
ubuntu:
image: ubuntu:18.04
volumes:
- .:/curso
working_dir: /curso

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',
{
"response": {
"status": 1000,
"transaction_id": "668484",
"message": {
"card": {
"id": "35449959",
"activated": "1",
"activation_code": null,
"expiration_date": "2017-09-30",

ActionParameter

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.

Before

@chebyte
chebyte / user.rb
Created July 1, 2013 14:02 — forked from harlow/user.rb
# app/models/user.rb
class User < ActiveRecord::Base
validates :zip_code, presence: true, zip_code: true
end
@chebyte
chebyte / json_rspec
Created June 28, 2013 15:51
custom rspec matcher for json
#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
# 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|
#!/bin/bash
LOADING=false
usage()
{
cat << EOF
usage: $0 [options] dbname
OPTIONS: