Skip to content

Instantly share code, notes, and snippets.

View minhphong306's full-sized avatar
😄
Don't watch the clock. Do what it does! Keep going!

Phong Do minhphong306

😄
Don't watch the clock. Do what it does! Keep going!
View GitHub Profile
@thgiang
thgiang / gist:e222f036806f126f51a0b75a81956c20
Created March 2, 2021 16:17
Control real chrome browser without notice: "Chrome is being controlled by automated test software"
Random rd = new Random();
string remote_port = rd.Next(9000, 9999).ToString();
// Open real Chrome
Process process = new Process();
process.StartInfo.UseShellExecute = true;
process.StartInfo.FileName = "chrome";
process.StartInfo.Arguments = "https://thgiang.com --load-extension=\"C:\\Users\\Admin\\Desktop\\my_extension\" --disable-gpu --new-window --remote-debugging-port=" + remote_port + " --user-data-dir=\"C:\\Profile\" --proxy-server=\""+proxy+"\" --disable-infobars --disable-notifications --window-size=1366,768"; //--window-position=0,0 --window-size=1200,800 --disable-images
process.Start();
Thread.Sleep(1000);
1. Make a directory for the django project
2. Install 'pipenv' in the system environment if not already
3. Create a virtual environment by running 'pipenv shell' (the location of the venv defaults to '~/user/.virtualenv/', to make it live inside the current directory, make an empty folder named '.venv', pipenv automatically detects that folder and creates the virtual environment inside that folder)
4. Now install django by running 'pipenv install django' (installs the latest version)
5. Start the project by running 'django-admin startproject $NAME_OF_THE_PROJECT'
6. To start the live server cd into the project and run 'python manage.py runserver port(optional)'
7. To make a new app inside that project run 'python manage.py startapp $NAME_OF_THE_APP'
@munho
munho / left_fn.json
Created June 3, 2020 23:55
Home, End, Page Up, Page Down keys for Logitech K380 (with Logitech Options uninstalled for fn and installed for option)
{
"title": "Home, End, Page Up, Page Down keys for Logitech K380 (with Logitech Options uninstalled)",
"rules": [
{
"description": "Change left arrow + fn to home",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "left_arrow",
@dzungtran
dzungtran / install-protoc-gen-go.md
Last active December 29, 2023 06:25
Install specify version for protoc-gen-go
GIT_TAG='v1.1.0'
go get -d -u github.com/golang/protobuf/protoc-gen-go
git -C "$(go env GOPATH)"/src/github.com/golang/protobuf checkout $GIT_TAG
go install github.com/golang/protobuf/protoc-gen-go

Check current protoc-gen-go location

@zulhfreelancer
zulhfreelancer / zsh-timestamp.md
Last active February 12, 2024 14:52
How to add timestamp on right hand side of ZSH / iTerm2 terminal prompt?

Add the following snippet at the bottom of ~/.zshrc file.

Option 1 - Just time

RPROMPT='[%D{%L:%M:%S}] '$RPROMPT
@lucasalvessouza
lucasalvessouza / install_postaman.sh
Created February 19, 2019 19:47
Install postman fedora
#!/bin/bash
wget https://dl.pstmn.io/download/latest/linux64 -O postman-linux-x64.tar.gz
sudo tar xvzf postman-linux-x64.tar.gz -C /opt
sudo ln -s /opt/Postman/Postman /usr/bin/postman
cat << EOF > ~/.local/share/applications/postman2.desktop
[Desktop Entry]
Name=Postman
GenericName=API Client
@hu2di
hu2di / ConvertVie.js
Last active December 30, 2023 18:17
JavaScript: Chuyển tiếng Việt có dấu sang không dấu
function removeVietnameseTones(str) {
str = str.replace(/à|á|ạ|ả|ã|â|ầ|ấ|ậ|ẩ|ẫ|ă|ằ|ắ|ặ|ẳ|ẵ/g,"a");
str = str.replace(/è|é|ẹ|ẻ|ẽ|ê|ề|ế|ệ|ể|ễ/g,"e");
str = str.replace(/ì|í|ị|ỉ|ĩ/g,"i");
str = str.replace(/ò|ó|ọ|ỏ|õ|ô|ồ|ố|ộ|ổ|ỗ|ơ|ờ|ớ|ợ|ở|ỡ/g,"o");
str = str.replace(/ù|ú|ụ|ủ|ũ|ư|ừ|ứ|ự|ử|ữ/g,"u");
str = str.replace(/ỳ|ý|ỵ|ỷ|ỹ/g,"y");
str = str.replace(/đ/g,"d");
str = str.replace(/À|Á|Ạ|Ả|Ã|Â|Ầ|Ấ|Ậ|Ẩ|Ẫ|Ă|Ằ|Ắ|Ặ|Ẳ|Ẵ/g, "A");
str = str.replace(/È|É|Ẹ|Ẻ|Ẽ|Ê|Ề|Ế|Ệ|Ể|Ễ/g, "E");
@jiskanulo
jiskanulo / pre-commit
Created June 16, 2015 12:23
Git pre-commit hook: detect file size over 100MB
#!/bin/sh
#
# An example hook script to verify what is about to be committed.
# Called by "git commit" with no arguments. The hook should
# exit with non-zero status after issuing an appropriate message if
# it wants to stop the commit.
#
# To enable this hook, rename this file to "pre-commit".
# Redirect output to stderr.
@splacentino
splacentino / jsp.md
Last active February 24, 2023 09:22
A JSP cheat sheet

Java expression evaluated at run time.

Prototype

<%=     %>

Example