Skip to content

Instantly share code, notes, and snippets.

View ankitsinghaniyaz's full-sized avatar
📺
Working Remote

Ankit Singhaniya ankitsinghaniyaz

📺
Working Remote
View GitHub Profile
@tomas-stefano
tomas-stefano / Capybara.md
Last active October 2, 2024 04:58
Capybara cheatsheet

Capybara Actions

# Anchor
click_link 'Save'

# Button
click_button 'awesome'

# Both above
@anotheruiguy
anotheruiguy / web-fonts-asset-pipeline.md
Last active June 24, 2024 22:11
Custom Web Fonts and the Rails Asset Pipeline

Web fonts are pretty much all the rage. Using a CDN for font libraries, like TypeKit or Google Fonts, will be a great solution for many projects. For others, this is not an option. Especially when you are creating a custom icon library for your project.

Rails and the asset pipeline are great tools, but Rails has yet to get caught up in the custom web font craze.

As with all things Rails, there is more then one way to skin this cat. There is the recommended way, and then there are the other ways.

The recommended way

Here I will show how to update your Rails project so that you can use the asset pipeline appropriately and resource your files using the common Rails convention.

@soheilhy
soheilhy / nginxproxy.md
Last active October 23, 2024 08:19
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@ankitsinghaniyaz
ankitsinghaniyaz / webdev.yaml
Created May 21, 2020 19:13
Ansible file to setup a web develoipment environment in an Ubuntu(ish) OS
# Set up a development environment on an Ubuntu flavored linux distribution
# install and sets up:
# rbenv, nvm, mysql, postgres, redis
# vscode, slack, docker, chormium, tilix, heroku, postman, beekeeper, skype, kazam, peek and more
# setup an rsa key
# Usage:
# install ansible 2.7+ - latest
## sudo apt-add-repository ppa:ansible/ansible && sudo apt update && sudo apt install ansible
# run the playbook:
## ansible-playbook webdev.yaml -K -e "email=<[email protected]>"
@bhaskar-f22
bhaskar-f22 / remove_sidekiq_job.rb
Last active July 19, 2021 14:28
This script is useful to kill running sidekiq jobs with particular class name
queue = Sidekiq::Queue.new("practice_fusion")
queue.each do |job|
job.delete if job.klass == 'PracticeFusionWorkers::PatientDocumentsSyncer'
end
# Way 2
ss = Sidekiq::ScheduledSet.new
jobs = ss.select {|job| job.klass == 'PracticeFusionWorkers::PatientDocumentsSyncer' }
jobs.each(&:delete)
@bhaskar-f22
bhaskar-f22 / Reclaim_mysql_space.sql
Created July 15, 2021 08:06
Reclam unused space from DB
-- First opthimize the table where you want to claim space
opthimize table <table-name>;
-- Delete logs except latest log file
show binary logs;
PURGE BINARY LOGS TO 'mysql-bin.006920';