Skip to content

Instantly share code, notes, and snippets.

View hungdev's full-sized avatar
💭
I may be slow to respond.

Hung Vu hungdev

💭
I may be slow to respond.
View GitHub Profile
@hungdev
hungdev / responsive.scss
Created June 1, 2023 08:34
a responsive mixin in SCSS
// SO responsive mixin
// a mixin is different from a function as it does not return a value but serves as placeholder for code
@mixin responsive( $breakpoint ) {
/*
breakpoints are viewport arbitrary values,
they are defined with the aim of allowing the SCSS/CSS code of your app' behave accordingly to your user's device width,
the breakpoints I used were inspired by Bootstrap =>
https://getbootstrap.com/docs/5.0/layout/breakpoints/
*/
@if $breakpoint == smartphone-portrait {
@hungdev
hungdev / Keys For Visual Studio Code.md
Created September 27, 2021 16:27 — forked from ZainaliSyed/Keys For Visual Studio Code.md
`Shortcuts & Command` for `React-Native `

React-Native Command

Windows Commands

  • rm node_modules/
  • use ; for muti line commands
  • rm $TMPDIR/react-* ; rm ios/build ; rm node_modules ; yarn cache clean ; npm cache verify

React Native

  • react-native --help
@hungdev
hungdev / axiosInterceptor.js
Created August 17, 2021 11:46 — forked from nzvtrk/axiosInterceptor.js
Axios create/recreate cookie session in node.js enviroment
/* Basic example of saving cookie using axios in node.js and session's recreation after expiration.
* We have to getting/saving cookie manually because WithCredential axios param use XHR and doesn't work in node.js
* Also, this example supports parallel request and send only one create session request.
* */
const BASE_URL = "https://google.com";
// Init instance of axios which works with BASE_URL
const axiosInstance = axios.create({ baseURL: BASE_URL });
@hungdev
hungdev / installing-node-with-nvm.md
Last active February 20, 2020 10:15 — forked from d2s/installing-node-with-nvm.md
Installing Node.js to Linux & macOS & WSL with nvm

Installing Node.js with nvm to Linux & macOS & WSL

A quick guide on how to setup Node.js development environment.

Install nvm for managing Node.js versions

nvm allows installing several versions of Node.js to the same system. Sometimes applications require a certain versions of Node.js to work. Having the flexibility of using specific versions can help.

  1. Open new Terminal window.
@hungdev
hungdev / docker_wordpress.md
Created August 9, 2019 03:45 — forked from bradtraversy/docker_wordpress.md
Docker Compose FIle For Wordpress, MySQL & phpmyadmin

Wordpress & Docker

This file will setup Wordpress, MySQL & PHPMyAdmin with a single command. Add the code below to a file called "docker-compose.yaml" and run the command

$ docker-compose up -d

# To Tear Down
$ docker-compose down --volumes
@hungdev
hungdev / Start and Stop Jenkins on OSX.md
Last active July 16, 2019 02:59 — forked from ehuynh/gist:2572398
Start and Stop Jenkins on OSX
###############################################################################
# SECTION:Initial Settings
###############################################################################
# ConfigServer Firewall & Security Configuration File
#
# Copyright 2006-2013, Way to the Web Limited
# URL: http://www.configserver.com
# Email: [email protected]
###############################################################################
@hungdev
hungdev / LC_CTYPE.txt
Created April 1, 2019 16:30 — forked from HJianBo/LC_CTYPE.txt
Centos warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory
vi /etc/environment
add these lines...
LANG=en_US.utf-8
LC_ALL=en_US.utf-8
@hungdev
hungdev / css-selectors.md
Created January 31, 2019 03:56 — forked from magicznyleszek/css-selectors.md
CSS Selectors Cheatsheet

CSS Selectors Cheatsheet

Element selectors

Element -- selects all h2 elements on the page

h2 {
    foo: bar;
@hungdev
hungdev / react-file-upload.js
Created November 10, 2018 16:25 — forked from AshikNesin/react-file-upload.js
Simple React File Upload
import React from 'react'
import axios, { post } from 'axios';
class SimpleReactFileUpload extends React.Component {
constructor(props) {
super(props);
this.state ={
file:null
}