Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

abhishek verma absk1317

🎯
Focusing
  • Mobikwik
  • BENGALURU/BANGALORE
View GitHub Profile
View like_observer.rb
# frozen_string_literal: true
class LikeObserver < BaseObserver
def after_commit(like)
AsyncWorker.perform_in(1.minutes, like.id, :update_indices)
AsyncWorker.perform_in(5.seconds, like.id, :create_notification) if create?(like)
end
class AsyncWorker
include Sidekiq::Worker
View business_contact_storage_worker.rb
# frozen_string_literal: true
class BusinessContactStorageWorker
include Sidekiq::Worker
sidekiq_options retry: false
attr_accessor :user_id, :contact_params, :business_id
def perform(contact_params, user_id, business_id = nil)
@user_id = user_id
@absk1317
absk1317 / users.rb
Created Aug 1, 2020
Google Sheets Entries
View users.rb
# frozen_string_literal: true
# For abstracting out updating approved businesses sheet
class GoogleSheets::Users
SHEET_NAME = 'users'
QUEUE_NAME = 'google_sheet'
include Sidekiq::Worker
sidekiq_options queue: QUEUE_NAME
sidekiq_options lock: :until_and_while_executing
@absk1317
absk1317 / image.rb
Created Aug 1, 2020
Async Image Processing
View image.rb
# frozen_string_literal: true
# == Schema Information
#
# Table name: images
#
# id :bigint not null, primary key
# deleted_at :datetime indexed
# height :decimal(, )
# image :string
View Nginx Prerender conf
server {
server_name xyz.com;
root /home/ubuntu/www;
large_client_header_buffers 4 16k;
client_max_body_size 4G;
keepalive_timeout 10;
gzip_static on;
View backup-gem.rb
# encoding: utf-8
Model.new(:producion_backup, 'Description for producion_backup') do
archive :configs do |archive|
archive.add "/home/ubuntu/projects/api/shared/config/"
archive.add '/etc/nginx/'
end
database PostgreSQL do |db|
db.name = "db_name"
@absk1317
absk1317 / app_version.gradle
Created Sep 20, 2019 — forked from IlyaEremin/app_version.gradle
Npm version for gradle
View app_version.gradle
def getVersionName = { getVersionProps()['appVersionName'] }
def getVersionProps() {
def versionPropsFile = file('gradle.properties')
if (!versionPropsFile.exists()) {
versionPropsFile.createNewFile()
}
def versionProps = new Properties()
versionProps.load(new FileInputStream(versionPropsFile))
return versionProps
@absk1317
absk1317 / clear_gitlab_artifacts.rb
Created Sep 16, 2019
delete old gitlab artifacts
View clear_gitlab_artifacts.rb
require 'httparty'
token = 'YOUR_TOKEN'
project_id = 'PROJECT_ID'
query = { per_page: 100 }
headers = { "PRIVATE-TOKEN" => token }
server = "https://gitlab.com/api/v4/projects/#{project_id}/jobs"
response = HTTParty.get(server, query: query, headers: headers)
View keybase.md

Keybase proof

I hereby claim:

  • I am absk1317 on github.
  • I am absk1317 (https://keybase.io/absk1317) on keybase.
  • I have a public key ASArQ2o2jBpV1x4h7vRMzBF9SJe53AQYyNOLiTFbeKnI-Qo

To claim this, I am signing this object:

@absk1317
absk1317 / .gitconfig
Created Aug 25, 2019 — forked from veggiemonk/.gitconfig
simple zshrc config file with Oh-My-ZSH
View .gitconfig
[user]
name = Julien Bisconti
email = ******
[core]
excludesfile = ~/.gitignore
pager = diff-so-fancy | less --tabs=1,5 -R
editor = /usr/bin/vim
[alias]
wow = log --all --graph --decorate --oneline --simplify-by-decoration
You can’t perform that action at this time.