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 / 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)
@thanakijwanavit
thanakijwanavit / loadawscred.py
Last active June 23, 2021 14:34
aws key installation in colab with aes pw encryption
from nicHelper.colab import autoSetupAws
from getpass import getpass
path = '/content/drive/MyDrive/.test'
autoSetupAws(path=path,
password = getpass('enter your password').encode(),
region='ap-southeast-1' )
@thanakijwanavit
thanakijwanavit / convertBase.py
Created April 19, 2021 06:58
convert int to base x
numpy.base_repr(10, base=3)
@thanakijwanavit
thanakijwanavit / deploy.yaml
Last active May 6, 2021 16:53
github action spec for deploy sam project
name: deploy
on:
push:
branches:
- 'master'
jobs:
build:
name: build
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.