Skip to content

Instantly share code, notes, and snippets.

View minhlong's full-sized avatar
🚀
Dev Dit Den 🚀

Timmy minhlong

🚀
Dev Dit Den 🚀
  • Viet Nam
View GitHub Profile

Zsh and Oh-My-Zsh on Ubuntu WSL

Bash on WSL is great.

But if you want a little extra from your terminal you can install zsh and oh-my-zsh pretty easily.

Prequisites

  • Ubuntu WSL

Install Zsh

@andersevenrud
andersevenrud / alacritty-tmux-vim_truecolor.md
Last active May 5, 2024 14:39
True Color (24-bit) and italics with alacritty + tmux + vim (neovim)

True Color (24-bit) and italics with alacritty + tmux + vim (neovim)

This should make True Color (24-bit) and italics work in your tmux session and vim/neovim when using Alacritty (and should be compatible with any other terminal emulator, including Kitty).

Testing colors

Running this script should look the same in tmux as without.

curl -s https://gist.githubusercontent.com/lifepillar/09a44b8cf0f9397465614e622979107f/raw/24-bit-color.sh >24-bit-color.sh
@naumanahmed19
naumanahmed19 / version-check.dart
Last active February 25, 2024 14:51
Flutter Force Update IOS and Android App Version
//Prompt users to update app if there is a new version available
//Uses url_launcher package
import 'package:url_launcher/url_launcher.dart';
const APP_STORE_URL =
'https://phobos.apple.com/WebObjects/MZStore.woa/wa/viewSoftwareUpdate?id=YOUR-APP-ID&mt=8';
const PLAY_STORE_URL =
'https://play.google.com/store/apps/details?id=YOUR-APP-ID';
@britonad
britonad / roles.py
Created November 20, 2017 15:46
Simple Flask MongoDB roles, permissions and decorator for views
import datetime
from functools import wraps
from werkzeug.security import (
generate_password_hash,
check_password_hash
)
from flask import abort
@paulredmond
paulredmond / ValidateMailgunWebhook.php
Created April 24, 2017 21:55
Laravel Middleware to Validate a signed Mailgun webhook
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Response;
/**
* Validate Mailgun Webhooks
* @see https://documentation.mailgun.com/user_manual.html#securing-webhooks
@beeman
beeman / remove-all-from-docker.sh
Created November 15, 2016 03:04
Remove all from Docker
# Stop all containers
docker stop `docker ps -qa`
# Remove all containers
docker rm `docker ps -qa`
# Remove all images
docker rmi -f `docker images -qa `
# Remove all volumes
@daredude
daredude / docker-clear.bat
Created June 5, 2016 10:53
delete all docker container and images on windows
@echo off
FOR /f "tokens=*" %%i IN ('docker ps -aq') DO docker rm %%i
FOR /f "tokens=*" %%i IN ('docker images --format "{{.ID}}"') DO docker rmi %%i
@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@sunitparekh
sunitparekh / git-pull-with-rebase-multi-repository-shell-script
Created September 3, 2015 04:38
Shell script to pull latest code from remote git repository for multiple projects
#!/bin/bash
repos=(
"/c/projects/project-1"
"/c/projects/project-2"
"/c/projects/project-3"
)
echo ""
echo "Getting latest for" ${#repos[@]} "repositories using pull --rebase"
@pingwping
pingwping / gist:92219a8a1e9d44e1dd8a
Last active March 6, 2023 18:35
Create and update embedded documents with MongoEngine
# REF: http://www.quora.com/How-do-I-create-and-update-embedded-documents-with-MongoEngine
class Comment(EmbeddedDocument):
content = StringField()
name = StringField(max_length=120)
class Post(Document):
title = StringField(max_length=120, required=True)
author = StringField(required=True)