Skip to content

Instantly share code, notes, and snippets.

View sanjayginde's full-sized avatar

Sanjay Ginde sanjayginde

View GitHub Profile
@AurelienGasser
AurelienGasser / linkedin-recruiter.js
Created February 23, 2023 10:04
Auto-expand list of experience items, color items based on duration, strikethrough based on keyboard, hide previously seen candidates.
// LinkedIn recruiter search results highlighter.
// Paste into your browser's JavaScript console.
//
// Features:
// - Auto-expand experience items
// - Color experience items based on duration (red if less than 1 year, green if 2y+, etc)
// - Strike-through experience items containing certain keywords
// - Record profiles already seen in search results and hide them in subsequent searches (to enable, set config variable to true below)
//
// If you make improvements, feel free to reach out and I can merge them. <aurelien.gasser at gmail.com>
@johnbeynon
johnbeynon / add_domain.rb
Last active May 19, 2024 07:24
Add custom domain to Render preview environment app
#!/usr/bin/ruby
# Script to add a custom domain to a preview environment web service. Use it via the buildCommand
#
# Resultant custom domain added to the service will be:
# <servicename>-pr-<number>.prs.mydomain.com
#
# Setup:
#
# Add a wildcard DNS entry to your domain, something like *.prs.mydomain.com pointing to 216.57.24.1
@simpsoka
simpsoka / Leadership-CI.md
Last active December 20, 2023 15:40
This is a list of questions to check our decision making.

Do I want to die on this hill?

  • Pass: This is morally good and if not handled has long term consequences
  • Fail: This if self serving

Am I including everyone?

  • Pass: My ego is not driving this conversation
  • Fail: The people in this conversation will only tell me I'm right and not push back
@existentialmutt
existentialmutt / db_fixtures_export.rake
Last active March 25, 2023 21:10 — forked from kuboon/db_fixtures_export.rake
Generate fixtures from db. Readable by rake db:fixtures:load
# lib/tasks/db_fixtures_export.rake
namespace 'db:fixtures' do
desc "generate fixtures from the current database"
task :export => :environment do
Rails.application.eager_load!
models = defined?(ApplicationRecord) ? ApplicationRecord.descendants : ActiveRecord::Base.descendants
models.each do |model|
puts "exporting: #{model}"
require 'ansi'
require 'sqlite3'
require 'active_record'
require 'elasticsearch/model'
require 'paperclip'
require "paperclip/railtie"
Paperclip::Railtie.insert
ActiveRecord::Base.logger = ActiveSupport::Logger.new(STDOUT)
# IMPORTANT: this example is potentially out of date. The latest version can be found here: https://github.com/papertrail/remote_syslog2/blob/master/examples/remote_syslog.ebextensions.config
# See http://help.papertrailapp.com/kb/hosting-services/aws-elastic-beanstalk/
# Usage:
# - replace <VERSION> with the version of remote_syslog2 you want to use. Example: .../download/v0.14/remote_syslog_linux_amd64.tar.gz
# - replace <YOUR-TRACKED-FILES> with the files you want to monitor for new log lines. Example: - /var/log/httpd/access_log
# - replace <YOUR-APP-NAME> with the name of the application
# - replace <YOUR-LOG-DESTINATION> and <YOUR-PORT-NUMBER> with the values shown under log destinations: https://papertrailapp.com/account/destinations
sources:
# config/routes.rb
resources :documents do
scope module: 'documents' do
resources :versions do
post :restore, on: :member
end
resource :lock
end
end
class Ticket < ActiveRecord::Base
belongs_to :grouper
belongs_to :user
validate :user_cant_be_blacklisted, on: :confirmation
validate :user_cant_double_book, on: :confirmation
validate :grouper_cant_be_full, on: :confirmation
validate :grouper_cant_have_occurred, on: :confirmation
@wycats
wycats / skylight.md
Created March 15, 2014 02:36
A walk through the Skylight UI

Response Time

There are several places that your application's response times appear in Skylight. It is important to note that we always show the 95th percentile response time, not the average. While this take significantly more computation on the backend to determine, it is a much, much better number to indicate real world performance than the average.

Averages are almost useless when thinking about web performance, and in the worst case, are actually misleading. For more information, see DHH's blog post The problem with averages. Google, Twitter, and GitHub (to name a few) all use 95th percentile numbers when tracking performance.

App Dashboard