Skip to content

Instantly share code, notes, and snippets.

View linhmtran168's full-sized avatar
🦖

Linh M. Tran linhmtran168

🦖
View GitHub Profile
@linhmtran168
linhmtran168 / s3Sync.sh
Created January 31, 2023 08:42 — forked from kellyrmilligan/s3Sync.sh
Sync files to s3 and set cache control headers
#!/bin/bash
if [[ "$1" != "" ]]; then
S3BUCKETNAME="$1"
else
echo ERROR: Failed to supply S3 bucket name
exit 1
fi
aws s3 sync build s3://$S3BUCKETNAME --delete --cache-control max-age=31536000,public
@linhmtran168
linhmtran168 / rspec_rails_set_session.md
Created October 25, 2022 07:32 — forked from dteoh/rspec_rails_set_session.md
Setting session variables in an RSpec Rails request spec

Setting session variables in an RSpec Rails request spec

You are writing a spec with type: :request, i.e. an integration spec instead of a controller spec. Integration specs are wrappers around Rails' ActionDispatch::IntegrationTest class. I usually write controller tests using this instead of type: :controller, mainly because it exercises more of the request and response handling stack. So instead of writing something like get :index to start the request, you would write get books_path or similar.

One of the issues with using type: :request is that you lose the ability to

@linhmtran168
linhmtran168 / settings.json
Created January 25, 2022 01:08
Vscode Ruby dev container configuration
{
"ruby.useBundler": true, // use the internal language server (see below)
"ruby.lint": {
"rubocop": {
"useBundler": true // enable rubocop via bundler
},
},
"ruby.useLanguageServer": false, // use the internal language server (see below)
"ruby.interpreter.commandPath": "/home/vscode/.rbenv/shims/ruby",
"ruby.pathToBundler": "/home/vscode/.rbenv/shims/bundle",
@linhmtran168
linhmtran168 / .wslconfig
Last active June 26, 2020 07:19
WSL config
# %USERPROFILE%.wslconfig
[wsl2]
memory=4GB
swap=2GB
processors=2
swapFile=D:\\wsl2-swap.vhdx
@linhmtran168
linhmtran168 / .eslintrc.json
Created March 12, 2020 12:04
ESLINT config
{
"env": {
"es6": true,
"node": true,
"browser": true,
"mocha": true
},
"extends": "standard",
"rules": {
"indent": [
@linhmtran168
linhmtran168 / settings.json
Last active June 4, 2020 01:30
Windows Terminal Config
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"defaultProfile" : "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
// Launch Settings
"initialCols": 120,
"initialRows": 30,
"launchMode": "default",
// Selection
Regex for matching ALL Japanese common & uncommon Kanji (4e00 – 9fcf) ~ The Big Kahuna!
([一-龯])
Regex for matching Hirgana or Katakana (*)
([ぁ-んァ-ン])
Regex for matching Non-Hirgana or Non-Katakana
([^ぁ-んァ-ン])
Regex for matching Hirgana or Katakana or basic punctuation (、。’)
@linhmtran168
linhmtran168 / .tmux.conf
Created May 22, 2019 10:09
WSL dotfiles
# Command prefix (like screen)
unbind C-b
set -g prefix C-a
bind-key a send-prefix
# force a reload of the config file
unbind r
bind r source-file ~/.tmux.conf
# basic settings
@linhmtran168
linhmtran168 / test.go
Created April 8, 2019 10:37
Pongo2 filter using reflect
// TrueCondition implement IConditionCheckable interface
func (test *TestStruct) TrueCondition() bool {
if test.IsTrue {
return true
}
return false
}
@linhmtran168
linhmtran168 / 00-SETUP.md
Last active March 28, 2024 09:33
Setup Redash for Oracle

Usage

Refs

https://redash.io/

Download Redash

$ curl -L -O https://github.com/getredash/redash/archive/v5.0.1.zip