Skip to content

Instantly share code, notes, and snippets.

View hungtienvu's full-sized avatar
🎯
Focusing

Hung Vu hungtienvu

🎯
Focusing
  • Toronto
View GitHub Profile
@hungtienvu
hungtienvu / mono-repo-shadcn.md
Last active March 31, 2024 14:31
Install Turbo Monorepo and shadcn

Here are the steps.

Please feel free to suggest for updates!

  1. Create a new mono repo project npx create-turbo@latest

  2. Update typescript-config/nextjs.json

@hungtienvu
hungtienvu / gist:ade0067c9368f687f25fe6f09dad04de
Created May 2, 2023 03:27
Spring security - custom provider
@Configuration
@EnableWebSecurity
@EnableGlobalMethodSecurity(prePostEnabled = true)
class WebSecurityConfiguration extends WebSecurityConfigurerAdapter {
@Autowired
private JwtTokenFilter jwtTokenFilter;
// @Autowired
// private UserDetailsService userDetailsService;
@hungtienvu
hungtienvu / _mobile-ready-web-app.html
Created May 25, 2022 05:29 — forked from hal0gen/_mobile-ready-web-app.html
iOS + Android settings for web applications
<!doctype html>
<!-- Adapted from https://gist.github.com/tfausak/2222823 -->
<html>
<head>
<title>Mobile-ready web app</title>
<!-- CONFIGURATION -->
:root {
--dark0: #2e3440;
--dark1: #3b4252;
--dark2: #434c5e;
--dark3: #4c566a;
--light0: #d8dee9;
--light1: #e5e9f0;
--light2: #eceff4;
@hungtienvu
hungtienvu / init.vim
Created June 2, 2020 19:54 — forked from celso/init.vim
Neovim setup for OSX users
syntax on
set ruler " Show the line and column numbers of the cursor.
set formatoptions+=o " Continue comment marker in new lines.
set textwidth=0 " Hard-wrap long lines as you type them.
set modeline " Enable modeline.
set esckeys " Cursor keys in insert mode.
set linespace=0 " Set line-spacing to minimum.
set nojoinspaces " Prevents inserting two spaces after punctuation on a join (J)
" More natural splits
set splitbelow " Horizontal split below current.
@hungtienvu
hungtienvu / tmux.conf
Created August 19, 2018 14:36 — forked from anantpatil/tmux.conf
My tmux configuration
# Settings courtesy internet
# Bind C-a (Ctrl+a) to default action on tmux
set-option -g prefix C-a
unbind C-b
# Command sequence for nested tmux when running tmux inside another tmux, you
# need to send command to inner tmux
bind-key a send-prefix
@hungtienvu
hungtienvu / README.md
Created February 25, 2016 04:35 — forked from oodavid/README.md
Deploy your site with git

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/
/* apply a natural box layout model to all elements */
*, *:before, *:after {
-moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box;
}

Magento Snippets

Download extension manually using pear/mage

Pear for 1.4, mage for 1.5. File downloaded into /downloader/.cache/community/

./pear download magento-community/Shipping_Agent
./mage download community Shipping_Agent

Clear cache/reindex

cd $HOME
ln -s `which php54` ~/bin/php
export PATH=$HOME/bin:$PATH
curl -sS https://getcomposer.org/installer | php54
echo -e "\n# Composer\nalias composer=\"php54 \$HOME/composer.phar\"" >> $HOME/.bash_profile
source $HOME/.bash_profile