Skip to content

Instantly share code, notes, and snippets.

View hungthai1401's full-sized avatar
🚀
Focusing

Thai Nguyen Hung hungthai1401

🚀
Focusing
View GitHub Profile
@hungthai1401
hungthai1401 / actionlist.vim
Created January 14, 2025 03:40 — forked from zchee/actionlist.vim
IdeaVim actionlist
--- Actions ---
$Copy <M-C>
$Cut <M-X> <S-Del>
$Delete <Del> <BS> <M-BS>
$LRU
$Paste <M-V>
$Redo <M-S-Z> <A-S-BS>
$SearchWeb <A-S-G>
$SelectAll <M-A>
$Undo <M-Z>
@hungthai1401
hungthai1401 / IdeaVim OS X Key Repeat.markdown
Created January 8, 2025 09:18 — forked from lsd/IdeaVim OS X Key Repeat.markdown
Enable key-repeat for ALL applications or just for IdeaVim/specific JetBrains apps

Upgrading to Lion or Yosemite and WebStorm 9, I noticed key repeat was
turned off for the IdeaVim plugin h j k l keys.

System-wide key repeat

defaults write -g ApplePressAndHoldEnabled -bool false in a terminal will enable
key repeat for every app. This can alternatively be found in the accessibility settings in OS X' preferences.

App specific key repeat

@hungthai1401
hungthai1401 / ssh_config
Created January 4, 2025 03:21 — forked from zeloc/ssh_config
example ssh config file used to create multiple host and assign different ssh keys
### default for all ##
Host *
ForwardAgent no
ForwardX11 no
ForwardX11Trusted yes
User nixcraft
Port 22
Protocol 2
ServerAliveInterval 60
ServerAliveCountMax 30
@hungthai1401
hungthai1401 / country-detect-cf-worker.js
Created December 27, 2024 10:14 — forked from sontl/country-detect-cf-worker.js
Country detection using CF Worker
addEventListener('fetch', event => {
event.respondWith(handleRequest(event.request))
})
async function handleRequest(request) {
const headers = {
'Access-Control-Allow-Origin': '*',
'Content-Type': 'application/json'
}

Brew Bundle Brewfile Tips

Copyright & License

Unless otherwise noted (either in this file or in a file's copyright section) the contents of this gist are Copyright ©️2020 by Christopher Allen, and are shared under spdx:Creative Commons Attribution Share Alike 4.0 International (CC-BY-SA-4.) open-source license.

Sponsor

If you more tips and advice like these, you can become a monthly patron on my GitHub Sponsor Page for as little as $5 a month; and your contributions will be multipled, as GitHub is matching the first $5,000! This gist is all about Homebrew, so if you like it you can support it by donating to them or becoming one of their Github Sponsors.

@hungthai1401
hungthai1401 / laravel-k8s-configmap.yaml
Created October 17, 2024 14:39 — forked from mkhmylife/laravel-k8s-configmap.yaml
Laravel Kubernetes Deployment files
apiVersion: v1
kind: ConfigMap
metadata:
name: backend-config
data:
APP_DEBUG: "false"
APP_ENV: production
APP_KEY: changeme
APP_LOG_LEVEL: debug
APP_NAME: "Laravel K8s"
@hungthai1401
hungthai1401 / gist:6ceef818fa41988ce8aa6e1403bb78ae
Created July 3, 2024 09:58 — forked from jaxbot/gist:5748513
Block nginx from serving .git directories
location ~ /\.git {
deny all;
}
# or, all . directories/files in general (including .htaccess, etc)
location ~ /\. {
deny all;
}
@hungthai1401
hungthai1401 / copy_redis_key.sh
Created October 18, 2023 03:37 — forked from ZwodahS/copy_redis_key.sh
copy a redis db key to another place (use MIGRATE COPY for v3.0<= redis)
#!/bin/bash
# source http://stackoverflow.com/questions/23222616/copy-all-keys-from-one-db-to-another-in-redis
#set connection data accordingly
source_host=localhost
source_port=6379
source_db=1
target_host=localhost
target_port=6379
target_db=2
@hungthai1401
hungthai1401 / JsonFileDataProviderIterator.php
Created July 14, 2023 03:46 — forked from jehoshua02/JsonFileDataProviderIterator.php
JsonFileDataProviderIterator class for use with PHPUnit @dataProvider annotation.
<?php
class JsonDataProviderIterator implements Iterator
{
protected $position = 0;
protected $array;
public function __construct($test, $namespace)
{
$path = preg_replace('/.php$/', '.data', $test) . '/' . $namespace;