This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# rails app:template LOCATION='https://gist.github.com/davidtolsma/3af8f8961abe3a635e41776fe2f3af54/raw' | |
# This sets up docker for rails with nginx, postgres, redis, sidekiq, and action_cable | |
# rails 6.1 | |
# ruby 2.7.2 | |
# required gems: pg, redis, sidekiq | |
# requires config/sidekiq.yml config/initializers/sidekiq.rb cable/config.ru | |
create_file 'docker/nginx/Dockerfile' do <<~YAML |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# rails app:template LOCATION='https://gist.github.com/davidtolsma/b59c85845a76b47d0cb94dc88f340d28' | |
def ask_with_default(prompt, default) | |
value = ask("#{prompt} (default: #{default})") | |
value.present? ? value : default | |
end | |
run "bundle add 'friendly_id'" | |
rails_command "generate friendly_id" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def uid(length=10) | |
dictionary = %w[A C D E F H J K L M N P R T W X Y Z 3 4 6 7 9] | |
dictionary_length = dictionary.length | |
uid = '' | |
(1..length).each do |n| | |
uid << dictionary[rand(0..dictionary_length)].to_s | |
end | |
uid |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Initially done in Rails 4.1, add the following to config/boot.rb | |
require 'webrick' | |
require 'webrick/https' | |
require 'rails/commands/server' | |
module Rails | |
# Override default development | |
# Server port | |
class Server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
desc "Create a self signed SSL certificate for Development" | |
task :create_ssl do | |
directory = '.ssl' | |
certificate_name = 'localhost' | |
ssl_utility = 'openssl' | |
application = system "#{ssl_utility} version" | |
# Check if openssl exists | |
if application.nil? | |
puts "#{ssl_utility} doesn't exist" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set TC_ROOT= | |
set TC_DATA= | |
call %TC_DATA%/tc_profilevars.bat |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo OFF | |
cls | |
TITLE SPLIT FILE | |
set originalFile=%1 | |
set splitLine=%2 | |
:: Where I'm running this script from | |
set thisScriptPath=%~dp0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo OFF | |
TITLE REFILE | |
:: Where I'm running this script from. | |
set currentDirectory=%~d0 | |
set currentPath=%~p0 | |
set thisScriptPath=%~dp0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo OFF | |
TITLE REFILE | |
cls | |
:: Where I'm running this script from. | |
set currentDirectory=%~d0 | |
set currentPath=%~p0 | |
set thisScriptPath=%~dp0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iman.h> | |
#include <sample_err.h> | |
#include <pom.h> | |
#include <item.h> | |
#include <aom.h> | |
#include <aom_prop.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <pom.h> |
NewerOlder