Skip to content

Instantly share code, notes, and snippets.

View samuel52's full-sized avatar
💭
I may be slow to respond.

Sammy Joseph samuel52

💭
I may be slow to respond.
View GitHub Profile
@samuel52
samuel52 / mysql-docker.sh
Created May 3, 2021 12:46 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@samuel52
samuel52 / docker-compose.yml
Created November 15, 2020 08:33 — forked from Mau5Machine/docker-compose.yml
Traefik Configuration and Setup
version: "3.3"
services:
################################################
#### Traefik Proxy Setup #####
###############################################
traefik:
image: traefik:v2.0
restart: always
//https://youtu.be/Mgs7jl430vs
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicReadGetObject",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
@samuel52
samuel52 / contact.haml
Created April 27, 2020 08:35 — forked from flores/contact.haml
Sinatra + Sanitize + AWS SES Contact form, example
%form{ :action => "/", :method => "post"}
%label{:for => "name"} name:
%input{:type => "text", :name => "name""}
%label{:for => "mail"} email:
%input{:type => "text", :name => "mail"}
%label{:for => "subject"} subject:
%input{:type => "text", :name => "subject"}
%label{:for => "body"} message:
%textarea{:name => "body"}
%input{:type => "submit", :value => "send", :value => "send"}
@samuel52
samuel52 / example1
Created April 21, 2020 21:15 — forked from daipresents/example1
Ruby rest-client file upload as multipart
require 'rest-client'
RestClient.get(url, headers={})
RestClient.post(url, payload, headers={})
@samuel52
samuel52 / app.rb
Created April 20, 2020 09:00 — forked from dansimco/app.rb
Concise Sinatra Amazon S3 Upload Example
require "rubygems"
require 'sinatra'
require "aws/s3"
get '/' do
return %Q{
<form action="upload" method="post" accept-charset="utf-8" enctype="multipart/form-data">
<div>
<input type="file" name="file" value="" id="file">
</div>
@samuel52
samuel52 / fetch-api-examples.md
Created July 19, 2018 00:38 — forked from justsml/fetch-api-examples.md
JavaScript Fetch API Examples