Skip to content

Instantly share code, notes, and snippets.

View brunurd's full-sized avatar

Bruno Araujo brunurd

View GitHub Profile
@devdrops
devdrops / example.md
Last active March 19, 2025 16:01
Mysqldump from Docker container

Mysqldump from Docker container

docker exec -i mysql_container mysqldump -uroot -proot --databases database_name --skip-comments > /path/to/my/dump.sql

OBS

  • This will generate a dump.sql file in your host machine. Awesome, eh?
  • Avoid using --compact on your dump. This will make MySQL check your constraints which will cause troubles when reading your file (damm you MySQL). And don't use --force to fix this scenario: recreate your dump without --compact ¯_(ツ)_/¯
@nagelflorian
nagelflorian / buckets.tf
Last active November 22, 2024 13:19
Terraform config for static website hosting on AWS
# AWS S3 bucket for static hosting
resource "aws_s3_bucket" "website" {
bucket = "${var.website_bucket_name}"
acl = "public-read"
tags {
Name = "Website"
Environment = "production"
}
@jcavat
jcavat / Dockerfile
Last active April 15, 2025 17:40
docker-compose with php/mysql/phpmyadmin/apache
FROM php:7.1.2-apache
RUN docker-php-ext-install mysqli
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active April 25, 2025 09:20
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@borekb
borekb / README.md
Last active November 15, 2024 23:41
Docker and Git Bash / MSYS2 on Windows: path conversion workaround

👋 Moved to https://github.com/borekb/docker-path-workaround


Docker in Git Bash / MSYS2 on Windows: path conversion workaround

UPDATE 07/2018: I switched from Git Bash to MSYS2 recently which should be very similar, if not the same, but there some subtle differences which made me realize this is more tricky than I thought and that I don't 100% understand what is going on. If someone can help, please let me know in the comments.

Invoking docker in MSYS2 shell or Git Bash typically fails with complains about paths, for example:

@joshnuss
joshnuss / udp_server.exs
Last active June 17, 2024 11:45
Fault tolerant UDP Server in Elixir
# to run:
# > elixir --no-halt udp_server.exs
# to test:
# > echo "hello world" | nc -u -w0 localhost 2052
# > echo "quit" | nc -u -w0 localhost 2052
# Let's call our module "UDPServer"
defmodule UDPServer do
# Our module is going to use the DSL (Domain Specific Language) for Gen(eric) Servers
use GenServer
@krzys-h
krzys-h / UnityWebRequestAwaiter.cs
Created July 20, 2018 22:47
[Unity] Use UnityWebRequest with async/await
public class UnityWebRequestAwaiter : INotifyCompletion
{
private UnityWebRequestAsyncOperation asyncOp;
private Action continuation;
public UnityWebRequestAwaiter(UnityWebRequestAsyncOperation asyncOp)
{
this.asyncOp = asyncOp;
asyncOp.completed += OnRequestCompleted;
}
@AveYo
AveYo / .. MediaCreationTool.bat ..md
Last active April 24, 2025 13:43
Universal MediaCreationTool wrapper for all MCT Windows 10 versions - MOVED TO github.com/AveYo/MediaCreationTool.bat
@alex3165
alex3165 / aws-lambda-authorizer-google.js
Created July 10, 2019 17:25
An AWS lambda authorizer that work with google access token
const axios = require("axios");
exports.handler = async event => {
const token = event.authorizationToken;
console.log(`Received token`, token);
let googleAuthRes;
try {
googleAuthRes = await axios.get(
`https://www.googleapis.com/oauth2/v1/tokeninfo?access_token=${token}`
@austinmartinh
austinmartinh / DB Instances
Created May 28, 2020 10:17
Results of describing DB instances
{
"DBInstances": [
{
"DBInstanceIdentifier": "hcdrestrictedzv6lsredhatrhmioperato-4hoz",
"DBInstanceClass": "db.t2.small",
"Engine": "postgres",
"DBInstanceStatus": "available",
"MasterUsername": "postgres",
"DBName": "postgres",
"Endpoint": {