Skip to content

Instantly share code, notes, and snippets.

View fabiensebban's full-sized avatar

Fabien Sebban fabiensebban

View GitHub Profile
@thbar
thbar / rails_lamby_notes.md
Created April 30, 2020 20:52 — forked from joshuap/rails_lamby_notes.md
Deploy a new Rails app to AWS Lambda using Lamby
@binhp
binhp / aws-upload-pdf.js
Last active April 11, 2024 11:53
Netsuite-AWS-UploadBinaryFile.js
require([
"N/render",
"N/file",
"N/encode",
"/SuiteScripts/lib/ns-aws-s3"
], function(render, file, encode, AWS) {
var xmlStr =
'<?xml version="1.0"?>\n' +
'<!DOCTYPE pdf PUBLIC "-//big.faceless.org//report" "report-1.1.dtd">\n' +
# Insomnia Configuration
## Run the test query
{
shop {
id
name
}
}
# Query Structure Examples
@satendra02
satendra02 / app.DockerFile
Last active March 3, 2024 10:13
docker+rails+puma+nginx+postgres (Production ready)
FROM ruby:2.3.1
# Install dependencies
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs
# Set an environment variable where the Rails app is installed to inside of Docker image:
ENV RAILS_ROOT /var/www/app_name
RUN mkdir -p $RAILS_ROOT
# Set working directory, where the commands will be ran:
MINIMUM_ORDER_AMOUNT = 50 #dollars required in cart to get discount
MESSAGE = "Minimum Order $50 Promotion" #promotional message
if !Input.cart.shipping_address.province.include?("Hawaii") && !Input.cart.shipping_address.province.include?("Alaska")
if Input.cart.subtotal_price_was > (Money.new(cents:100) * MINIMUM_ORDER_AMOUNT)
Input.shipping_rates.each do |shipping_rate|
if shipping_rate.name.include?("2 Day Ground")
shipping_rate.change_name("Free 2 Day Ground", { message: "" })
shipping_rate.apply_discount(shipping_rate.price, message: MESSAGE)
end
@mihow
mihow / load_dotenv.sh
Last active May 4, 2024 12:32
Load environment variables from dotenv / .env file in Bash
if [ ! -f .env ]
then
export $(cat .env | xargs)
fi
@zulhfreelancer
zulhfreelancer / readline_bundle_image_not_found.md
Last active November 3, 2021 20:50
How to fix 'readline.bundle image not found' problem?

If you get error like this:

Running via Spring preloader in process 7662
/Users/zulh/.rvm/gems/ruby-2.3.1@useradmin/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in `require': dlopen(/Users/zulh/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/x86_64-darwin15/readline.bundle, 9): Library not loaded: /usr/local/opt/readline/lib/libreadline.6.dylib (LoadError)
  Referenced from: /Users/zulh/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/x86_64-darwin15/readline.bundle
  Reason: image not found - /Users/zulh/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/x86_64-darwin15/readline.bundle
	from /Users/zulh/.rvm/gems/ruby-2.3.1@useradmin/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in `block in require'
	from /Users/zulh/.rvm/gems/ruby-2.3.1@useradmin/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:240:in `load_dependency'
	from /Users/zulh/.rvm/gems/ruby-2.3.1@useradmin/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in `require'
@neckhair
neckhair / .dockerignore
Created November 15, 2016 09:48
Sample dockerignore for a Rails app
.git
.gitignore
README.md
#
# OS X
#
.DS_Store
.AppleDouble
.LSOverride
@alanwill
alanwill / api-gateway-mapping-template.json
Created April 3, 2016 06:34
AWS API Gateway Mapping Template
{
"body" : $input.json('$'),
"headers": {
#foreach($header in $input.params().header.keySet())
"$header": "$util.escapeJavaScript($input.params().header.get($header))" #if($foreach.hasNext),#end
#end
},
"method": "$context.httpMethod",
"params": {
@magnetikonline
magnetikonline / README.md
Last active June 7, 2023 20:57
AWS Elastic Beanstalk deploy user restricted IAM policy.

AWS Elastic Beanstalk deploy user restricted IAM policy

An IAM user policy document to give minimal rights for deploying an Elastic Beanstalk application.

Where:

  • REGION: AWS region.
  • ACCOUNT_ID: AWS account ID.
  • APPLICATION_NAME: Desired target Elastic Beanstalk application name(space).
  • IAM_INSTANCE_PROFILE_ROLE: The instance profile (IAM role) Elastic Beanstalk EC2 instaces will run under.