Skip to content

Instantly share code, notes, and snippets.

Avatar
😁
Grateful

Chris Irish supairish

😁
Grateful
View GitHub Profile
@supairish
supairish / gist:bacca03a24c811df414dc0c82567aef9
Created Jul 16, 2021 — forked from jellea/gist:3438926
Webcam snapshot on every git commit
View gist:bacca03a24c811df414dc0c82567aef9
#!/bin/bash
#
# This script will make a webcam snapshot every commit. The jpg file will have
# the commit id as the filename.
#
# This script requires imagesnap. Install with: 'brew install imagesnap'
#
# Put this file in the '.git/hooks/' name it 'post-commit' and chmod it by:
# 'chmod +x .git/hooks/post-commit'
#
@supairish
supairish / Rails_mini_file_test.rb
Created Jul 2, 2021
Rails mini file test example
View Rails_mini_file_test.rb
# frozen_string_literal: true
require "bundler/inline"
gemfile(true) do
source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
# Activate the gem you are reporting the issue against.
@supairish
supairish / tz_identifiers_to_rails_identifiers.rb
Created May 19, 2021 — forked from jpmckinney/tz_identifiers_to_rails_identifiers.rb
Maps tz database time zone identifiers to Rails time zone identifiers
View tz_identifiers_to_rails_identifiers.rb
# blog post: http://blog.slashpoundbang.com/post/2613268281/changing-from-tz-database-identifiers-to-rails-friendly
{
"Australia/Adelaide" => "Adelaide",
"Australia/Broken_Hill" => "Adelaide",
"America/Anchorage" => "Alaska",
"America/Juneau" => "Alaska",
"America/Nome" => "Alaska",
"America/Yakutat" => "Alaska",
"Pacific/Gambier" => "Alaska",
"Asia/Almaty" => "Almaty",
@supairish
supairish / iana-to-activerecord-bullshit-timezone-mapping.py Zendesk timezones are represented by friendly names that map to tz database names. For example, an API request returns "Eastern Time (US & Canada)" instead of "America/New_York". You can map the friendly names to the tz database names by referencing the Constants > Mapping section of the Ruby on Rails TimeZone object doc. https://developer.zende…
View iana-to-activerecord-bullshit-timezone-mapping.py
# -*- coding: utf-8 -*-
"""
Zendesk timezones are represented by friendly names that map to tz database names.
For example, an API request returns "Eastern Time (US & Canada)" instead of "America/New_York".
You can map the friendly names to the tz database names by referencing the Constants > Mapping
section of the Ruby on Rails TimeZone object doc.
https://developer.zendesk.com/rest_api/docs/core/users#time-zone
@supairish
supairish / Gemfile
Created May 8, 2021 — forked from dhh/Gemfile
HEY's Gemfile
View Gemfile
ruby '2.7.1'
gem 'rails', github: 'rails/rails'
gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data
# Action Text
gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra'
gem 'okra', github: 'basecamp/okra'
# Drivers
View gist:ddaa7db8d67b669473ade9dc66cc5515
### Keybase proof
I hereby claim:
* I am supairish on github.
* I am supairish (https://keybase.io/supairish) on keybase.
* I have a public key ASBs78D4qoRMMf3LvyFEPFkMcIjjJfa72T86ts8sMRZIRwo
To claim this, I am signing this object:
View test_stripe.rb
require 'bundler/inline'
gemfile do
source 'https://rubygems.org'
gem 'selenium-webdriver', '3.142.3'
gem 'webdrivers'
gem 'capybara', '3.28.0'
gem 'byebug'
end
View etc-hosts-on-win.md

1. Get your IP Address

echo `ifconfig $(netstat -nr | grep -e default -e "^0\.0\.0\.0" | head -1 | awk '{print $NF}') | grep -e "inet " | sed -e 's/.*inet //' -e 's/ .*//' -e 's/.*\://'`

2. Modify your hosts file

notepad

@supairish
supairish / capybara.rb
Created Feb 23, 2019 — forked from guzart/capybara.rb
Capybara configuration to run a webpack dev server for e2e testing
View capybara.rb
# spec/support/capybara.rb
require 'capybara/rails'
require 'capybara/rspec'
# port and url to webpack server
WEB_TEST_PORT = '5005'.freeze
WEB_TEST_URL = "http://localhost:#{WEB_TEST_PORT}".freeze
def capybara_wait_for_webpack_server
10.times.each do |_|