Skip to content

Instantly share code, notes, and snippets.

View Al-un's full-sized avatar
💭
Plop

Al-un Al-un

💭
Plop
  • Tokyo
View GitHub Profile
@Al-un
Al-un / aws_cloudformation_s3_hosting.yml
Last active April 29, 2024 02:34
AWS CloudFormation configuration for a HTTPS S3 static hosting: S3+Route53+CloudFront
# AWS CloudFormation template file follows the following anatomy:
# https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html
# More documentation in the API reference:
# https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/Welcome.html
# As-of 2020, "2010-09-09" is the latest FormatVersion:
# https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/format-version-structure.html
AWSTemplateFormatVersion: 2010-09-09
Description: S3 / Route53 / CloudFront CloudFormation configuration
@Al-un
Al-un / Cuisine.md
Last active October 5, 2020 13:59
@Al-un
Al-un / installation.md
Last active April 26, 2020 06:46
Memo for various installations
@Al-un
Al-un / aws_load_bucket_info.sh
Created March 14, 2019 16:08
Multiple "aws s3 ls" to fetch buckets info and parse it
#!/bin/bash
# ---------- Help
# https://stackoverflow.com/a/51911626/4906586
__help="
Usage:
./load.sh --awsBuckets=pouet --awsProfile=MyProfile --parser=../haha
Options:
-b, --awsBuckets=<buckets> list of buckets to load from AWS. If
@Al-un
Al-un / himadari_acoustic.ps
Created February 6, 2019 18:12
Hidamari Acoustic
foreach($song in (Get-ChildItem -Recurse -Filter *acoustic*.mp3)){vlc $song.FullName}
@Al-un
Al-un / regex_mass_rename.ps1
Created November 18, 2018 16:47
Renaming files based on Regex matched groups
Get-ChildItem | Rename-Item -WhatIf -NewName {$_.Name -replace '(\d{2})-(\d{2})-(\d{4})', '$3-$2-$1' }
@Al-un
Al-un / testing_colors.rb
Last active November 3, 2018 17:54
Testing colours printing on various console. Colours source: https://github.com/TwP/logging/blob/master/lib/logging/color_scheme.rb#L211
# Testing colours printing on VisualStudio console and PowerShell to check how
# colours are represented. This is for choosing color scheme of logging library
# Constants source: https://github.com/TwP/logging/blob/master/lib/logging/color_scheme.rb
module Color
# Miscellaneous stuff
module Misc
# Embed in a String to clear all previous ANSI sequences. This *MUST* be
# done before the program exits!
CLEAR = "\e[0m".freeze
@Al-un
Al-un / rails_logging_05_controller.rb
Last active October 29, 2018 14:54
Testing tagged logs
# controllers/catalogs_controller.rb
def show
@catalog = Catalog.includes(article_publications: [:article]).find(params[:id])
logger.debug "Debugging: showing catalogs #{@catalog.id}"
logger.info "Info: showing catalogs #{@catalog.id}"
logger.warn "Warn: showing catalogs #{@catalog.id}"
# add some tagged logs here
logger.tagged("Catalogs show") { logger.debug "Moar stuff" }
logger.tagged("Catalogs show") { logger.info "Stuff" }
logger.tagged("Catalogs show") { logger.tagged("Nested tag") { logger.info "Stuff" } }