Skip to content

Instantly share code, notes, and snippets.

View thanakijwanavit's full-sized avatar
🎯
Focusing

Nic Wanavit thanakijwanavit

🎯
Focusing
View GitHub Profile
@thanakijwanavit
thanakijwanavit / deleteStack.sh
Created May 21, 2021 03:34
delete cloudformation stack
aws cloudformation delete-stack --stack-name villa-search-3-dev-manual
@thanakijwanavit
thanakijwanavit / invalidate.py
Last active May 19, 2021 12:03
invalidate in cloudfront
from nicHelper.cloudfront import invalidate
invalidate('E1I41NH6AGDJM8', path='/public/imagenames/*')
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@thanakijwanavit
thanakijwanavit / fish_user_key_bindings.fish
Created May 4, 2021 17:39
set vim binding for fish and foward control f
function fish_user_key_bindings
fish_vi_key_bindings
for mode in insert default visual
bind -M $mode \cf forward-char
end
end
@thanakijwanavit
thanakijwanavit / fish_mode_prompt.fish
Last active May 4, 2021 18:44
fishConfig for vim cursor
function fish_mode_prompt
switch $fish_bind_mode
case default
echo -en "\e[2 q"
set_color -o brwhite
echo "[ "
set_color -o brred
echo "N"
set_color -o brwhite
echo " ]"
@thanakijwanavit
thanakijwanavit / sampleLambdaEdgeInput.json
Created May 2, 2021 15:38
sample lambda edge input for removing path example
{
"Records": [
{
"cf": {
"config": {
"distributionDomainName": "d111111abcdef8.cloudfront.net",
"distributionId": "EDFDVBD6EXAMPLE",
"eventType": "viewer-request",
"requestId": "4TyzHTaYWb1GX1qTfsHhEqV6HUDd_BzoBZnwfnvQc_1oF26ClkoUSEQ=="
},
@thanakijwanavit
thanakijwanavit / villa.kitchen.yaml
Created May 1, 2021 09:36
villa kitchen cf distribution config
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: >
VillaCloudfront endpoint for website backend
Parameters:
BRANCH:
Type: String
Default: dev-blank
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@thanakijwanavit
thanakijwanavit / inspect.py
Created April 25, 2021 16:36
inspect code, get the source code of functions
from inspect import getsource
getsource(map)