Skip to content

Instantly share code, notes, and snippets.

View JFernandezWM's full-sized avatar

Jose C Fernandez JFernandezWM

View GitHub Profile
@JFernandezWM
JFernandezWM / sequel-tinytds-mssql-example.md
Created June 13, 2018 18:53 — forked from albertico/sequel-tinytds-mssql-example.md
A sample script for connecting to MS SQL Server database using Sequel ORM with the TinyTDS adapter.

Ruby Sequel TinyTDS MS SQL Example

A sample script for connecting to MS SQL Server database using Sequel ORM with the TinyTDS (FreeTDS) adapter.

#!/usr/bin/env ruby

require 'sequel'
require 'tiny_tds'
@JFernandezWM
JFernandezWM / sequel-tinytds-mssql-example.md
Created June 13, 2018 18:53 — forked from albertico/sequel-tinytds-mssql-example.md
A sample script for connecting to MS SQL Server database using Sequel ORM with the TinyTDS adapter.

Ruby Sequel TinyTDS MS SQL Example

A sample script for connecting to MS SQL Server database using Sequel ORM with the TinyTDS (FreeTDS) adapter.

#!/usr/bin/env ruby

require 'sequel'
require 'tiny_tds'
@JFernandezWM
JFernandezWM / gist:d2e0e31afe8f9681612f05c578d94e01
Last active February 25, 2021 14:27
Update to factory bot shell scripts for Mac that actually work...
find . -type f -name '*.rb' -exec sed -i '' s/FactoryGirl/FactoryBot/ {} +
find . -type f -name '*.rb' -exec sed -i '' s/factory_girl/factory_bot/ {} +
This:
from https://github.com/thoughtbot/factory_bot_rails/issues/247
grep -rl 'FactoryGirl' ./ | xargs sed -i '' 's/FactoryGirl/FactoryBot/g'
@JFernandezWM
JFernandezWM / ruby_on_rails_deployment.md
Created July 26, 2018 01:50 — forked from zentetsukenz/ruby_on_rails_deployment.md
Deploy Ruby on Rails application with Docker Compose and Capistrano with ease

#Docker

##Files and Folders.

|
|\_ app
|...
|\_ docker
| |
@JFernandezWM
JFernandezWM / .rubocop.yml
Last active August 1, 2018 16:26
Rubocop config for Rails apps
inherit_from: .rubocop_todo.yml
Rails:
Enabled: false
AllCops:
TargetRubyVersion: 2.4
Exclude:
- "vendor/**/*"
- "db/schema.rb"
- "node_modules/**/*"
@JFernandezWM
JFernandezWM / .rubocop.yml
Created August 1, 2018 16:27
Rubocop config for Ruby gems
AllCops:
TargetRubyVersion: 2.4.1
Exclude:
- "vendor/**/*"
- bin/*
Layout/DotPosition:
Description: Checks the position of the dot in multi-line method calls.
StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains
Enabled: true
EnforcedStyle: leading
@JFernandezWM
JFernandezWM / nginxproxy.md
Created August 9, 2018 19:59 — forked from soheilhy/nginxproxy.md
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

puma (3.11.4)
rails 5.2.0
ruby 2.5
dockerized environment
My puma.rb:
# Puma can serve each request in a thread from an internal thread pool.
# The `threads` method setting takes two numbers: a minimum and maximum.
# Any libraries that use thread pools should be configured to match
# the maximum value specified for Puma. Default is set to 5 threads for minimum
@JFernandezWM
JFernandezWM / sublime-text-macos-context-menu.md
Created August 28, 2018 12:11 — forked from idleberg/sublime-text-macos-context-menu.md
“Open in Sublime Text” in macOS context-menu

Open in Sublime Text

  • Open Automator
  • Create a new Service
  • Set “Service receives selected” to files or folders in any application
  • Add a Run Shell Script action
  • Set the script action to /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl -n "$@"
  • Set “Pass input” to as arguments
  • Save as Open in Sublime Text
@JFernandezWM
JFernandezWM / GitCommitEmoji.md
Created January 11, 2019 15:49 — forked from parmentf/GitCommitEmoji.md
Git Commit message Emoji