Skip to content

Instantly share code, notes, and snippets.

View charusat09's full-sized avatar

Mayurkumar charusat09

View GitHub Profile
Mayur~/Desktop/Mayur/VS/pickk-pickk-import-cbcb1245fdee pm2 start pm2/actors.dev.json
[PM2][WARN] You are starting 1 processes in fork_mode without load balancing. To enable it remove -x option.
[PM2][WARN] You are starting 1 processes in fork_mode without load balancing. To enable it remove -x option.
[PM2] Applying action restartProcessId on app [ImportGames](ids: 0)
[PM2][ERROR] Process 0 not found
Process not found
[PM2] Applying action restartProcessId on app [ImportFutureGames](ids: 1)
[PM2][ERROR] Process 1 not found
Process not found
┌───────────────────┬────┬──────┬──────┬─────────┬─────────┬────────┬─────┬────────┬──────────┐
@charusat09
charusat09 / gist:dcda5f7778867c9c3e4e1ab54886c056
Created December 19, 2016 08:46
BigCommerce Product response
{
"data": [
{
"id": 11,
"name": "Test",
"type": "physical",
"sku": "TEST-TEST",
"description": "<p>Awesome product</p>",
"weight": 1,
"width": 10,
# Gemfile
gem 'capistrano', require: false
gem 'capistrano-rvm', require: false
gem 'capistrano-rails', require: false
gem 'capistrano-bundler', require: false
gem 'capistrano3-puma', require: false
# Capfile
@charusat09
charusat09 / nginx-default-file-example
Created August 21, 2017 11:46
This is example for /etc/nginx/sites-available/default file
upstream puma {
server unix:///var/www/apps/PROJECT/shared/sockets/puma.sock;
}
server {
listen 80;
server_name 'example.com';
# Discourage deep links by using a permanent redirect to home page of HTTPS site
#return 301 https://$host;
var delay = 5 * 1000; // will sleep for 5 seconds
// add sites in this array with comma seperated
var values = [
"https://www.google.com",
"https://linkedin.com"
];
for (var i = 0; i < values.length; i++) {
sleep(delay);
########## wireless info START ##########
Report from: 10 Mar 2018 10:40 IST +0530
Booted last: 10 Mar 2018 10:33 IST +0530
Script from: 10 Jan 2018 20:04 UTC +0000
##### release ###########################
@charusat09
charusat09 / zlib_test.rb
Last active May 1, 2018 12:50
Zlib CRC32 alogorithm test
require "zlib"
# total percentage = 100
PER_1 = 20
PER_2 = 30
PER_3 = 50
ids = [*(1..1000)].map(&:to_s)
libs = []
PER_1 = 20
PER_2 = 35
PER_3 = 45
POOL_SIZE = 10
ids = [*(1..1000)]
a1 = (PER_1 / POOL_SIZE).ceil
a2 = (PER_2 / POOL_SIZE).ceil
a3 = POOL_SIZE - a1 - a2
@charusat09
charusat09 / csv_parser.rb
Created May 3, 2018 11:00
This script will read data from provided file and also use master data file to map ids to data from it.
require "csv"
require "byebug"
class ParseCSV
attr_reader :file, :store, :table
def initialize(file_path)
@file = CSV.read(file_path, headers: true, row_sep: :auto)
@table = CSV.read("table.csv", headers: true, row_sep: :auto)
@store = []
class Rotator
attr_accessor :id, :values
BASE = 10
def initialize(id, values)
@id = id
@values = values
end
def rotate