Skip to content

Instantly share code, notes, and snippets.

View chebyte's full-sized avatar
🤡
smile

maurotorres chebyte

🤡
smile
View GitHub Profile
@chebyte
chebyte / setup.md
Created January 9, 2013 22:36 — forked from leesmith/setup.md

Ruby on Rails development setup on Ubuntu 12.04

System update

# change mirror to ubuntu.osuosl.org first
sudo apt-get update

Install common libraries

@chebyte
chebyte / Nginx - Unicorn
Last active December 15, 2015 19:39 — forked from keikubo/README.md
Nginx + Unicorn for Rails on Rackhub
=========
## Description:
This script enables you to launch your Rails application in production environment (port:80) with Nginx and Unicorn.
## Installation:
Please make sure that your Gemfile in your rails application includes unicorn.
#!/bin/bash
LOADING=false
usage()
{
cat << EOF
usage: $0 [options] dbname
OPTIONS:
# 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|
@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

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',
@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){
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);