Skip to content

Instantly share code, notes, and snippets.

View bookmebus's full-sized avatar
🎯
Focusing

BookMeBus bookmebus

🎯
Focusing
View GitHub Profile
@bookmebus
bookmebus / .dockerignore
Created January 9, 2020 08:40 — forked from davidderus/.dockerignore
Docker + Rails + Puma + Postgres + Nginx
.git
.gitignore
/doc
.yardoc
coverage
jsdoc
/tmp
/log
Dockerfile
Dockerfile.prod
@bookmebus
bookmebus / install_ffmpeg_ubuntu.sh
Created March 27, 2019 07:35 — forked from channainfo/install_ffmpeg_ubuntu.sh
Install latest ffmpeg on ubuntu 12.04 or 14.04, 16.04
#!/bin/bash
# Bash script to install latest version of ffmpeg and its dependencies on Ubuntu 12.04 or 14.04
# Inspired from https://gist.github.com/faleev/3435377
# Remove any existing packages:
sudo apt-get -y remove ffmpeg x264 libav-tools libvpx-dev libx264-dev
# Get the dependencies (Ubuntu Server or headless users):
sudo apt-get update
@bookmebus
bookmebus / 01_add_cors.config.yaml
Created February 7, 2019 11:13 — forked from vsviridov/01_add_cors.config.yaml
Add CORS to Nginx on AWS Elastic Beanstalk
container_commands:
01_fix_static_cors:
command: "/tmp/fix_static_cors.sh"
files:
"/tmp/fix_static_cors.sh":
mode: "000755"
owner: root
group: root
content: |
#!/bin/bash
@bookmebus
bookmebus / yarn.config
Last active January 24, 2019 02:17
React rails, webpacker elasticbeanstalk deployment Rails5.2.5 ebextensions
files:
"/opt/elasticbeanstalk/hooks/appdeploy/pre/09_yarn.sh" :
mode: "000755"
owner: root
group: root
content: |
#!/usr/bin/env bash
set -xe
EB_SCRIPT_DIR=$(/opt/elasticbeanstalk/bin/get-config container -k script_dir)
@bookmebus
bookmebus / pumaconf.conf
Created November 25, 2018 03:15
ElasticBeanStalk custom puma config for multiprocess x workers.
container_commands:
# directory '/var/app/current'
# threads 8, 32
# workers %x(grep -c processor /proc/cpuinfo)
# bind 'unix:///var/run/puma/my_app.sock'
# pidfile '/var/run/puma/puma.pid'
# stdout_redirect '/var/log/puma/puma.log', '/var/log/puma/puma.log', true
# daemonize false
01backup_config:
@bookmebus
bookmebus / pumaconf.conf
Created November 25, 2018 03:15
ElasticBeanStalk custom puma config for multiprocess x workers.
container_commands:
# directory '/var/app/current'
# threads 8, 32
# workers %x(grep -c processor /proc/cpuinfo)
# bind 'unix:///var/run/puma/my_app.sock'
# pidfile '/var/run/puma/puma.pid'
# stdout_redirect '/var/log/puma/puma.log', '/var/log/puma/puma.log', true
# daemonize false
01backup_config:
@bookmebus
bookmebus / eb-extension-rails-yarn.config
Created November 12, 2018 14:47
Elasticbeanstalk rails 5.2.5 with reactjs, react-rails, yarn and puma
files:
"/opt/elasticbeanstalk/hooks/appdeploy/pre/09_yarn.sh" :
mode: "000755"
owner: root
group: root
content: |
#!/usr/bin/env bash
set -xe
EB_SCRIPT_DIR=$(/opt/elasticbeanstalk/bin/get-config container -k script_dir)
@bookmebus
bookmebus / interpolation.go
Created October 26, 2018 02:40
String interpolation
// import format
import ( "fmt" )
date := fmt.Sprintf("%d-%d-%d", year, month, day)
time := fmt.Sprintf("%d:%d:%d", hour, minute, second)
datetime := fmt.Sprintf("%s,%s", date, time)
@bookmebus
bookmebus / shouldgo1.go
Created October 26, 2018 01:59
Getting started with go
package main
import (
"fmt"
)
func main(){
var age int
age = 10.0
@bookmebus
bookmebus / modify_query_string.js
Last active August 10, 2018 06:10
Add or Modify url query string with javascript and JQuery
// Not Required Jquery
// currentURL = location.protocol + '//' + location.host + location.pathname + location.search + location.hash
function ModifyQueryString(url, newKey, newValue){
var params = {}
var urlSplits = url.split("?");
var baseURL = urlSplits[0]
var queryString = urlSplits[1]
if(!queryString) {