Skip to content

Instantly share code, notes, and snippets.

View imcvampire's full-sized avatar
🎯
Focusing

Quoc-Anh Nguyen imcvampire

🎯
Focusing
View GitHub Profile
@imcvampire
imcvampire / red_stderr.sh
Created November 19, 2021 10:22 — forked from tmatilai/red_stderr.sh
Make direnv error messages red
#!/usr/bin/env bash
#
# Color all stderr output from .envrc evaluation.
# Copy this file to ~/.config/direnv/lib/red_stderr.sh
# Override the direnv stdlib function to print with "normal" color
log_status() {
if [[ -n $DIRENV_LOG_FORMAT ]]; then
local msg=$*
local color_normal
@imcvampire
imcvampire / housekeeping_images.sh
Created November 18, 2019 10:12 — forked from DaanGeurts/housekeeping_images.sh
Deleting unused images from Google Container Registry, leaving x number left
#!/bin/bash
# Copyright © 2017 Google Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
66 5.59 8.85 3.73
66.33333333 5.42 7.97 3.71
61.83333333 4.96 9.13 3.35
37.33333333 3.7 8.67 3.79
62.5 5.96 7.86 3.63
67 4.01 7.46 3.79
45.5 1.79 8.51 3.68
29.5 1.85 6.32 3.63
73.33333333 3.16 7.66 3.79
103.3333333 2.97 6.91 3.7
@imcvampire
imcvampire / crxMouse.json
Created July 10, 2018 09:42
crxMouse config
{
"isOnboardingShownOnce": false,
"isGesturesOff": false,
"cfgver": 2.3,
"others": {
"tuilink": false
},
"normal": {
"gesture": true,
"drag": true,
" leader
let mapleader = ','
let g:mapleader = ','
" syntax
syntax on
" history : how many lines of history VIM has to remember
set history=2000
@imcvampire
imcvampire / cvim
Last active July 2, 2018 09:22
cvim
set smoothscroll
set noautofocus
let mapleader = ","
" Mappings
map <Leader>r reloadTabUncached
map <Leader>x :restore<Space>
let completionengines = ['google', 'wikipedia', 'google-image', 'youtube', 'imdb']
#
# Setting Tmux version: https://stackoverflow.com/a/40902312/1046584
#
run-shell "tmux setenv -g TMUX_VERSION $(tmux -V | cut -c 6-)"
#
# Better prefix
#
const glob = require("glob");
const fs = require("fs");
const path = require("path");
const basePath = path.resolve(process.cwd());
const packageJSON = JSON.parse(fs.readFileSync(path.join(basePath, 'package.json')).toString());
const supportedLanguages = packageJSON.config['supported-languages'];
const defaultLanguage = packageJSON.config['default-language'];
const translations = {};
const sanitizeMessage = (message) => {
const replacements = [
  1. Never push straight to master, dev branch.
    • master is production/final branch.
    • dev is for developing, building and testing in test server.
  2. If you want to add new feature or fix bug, create new branch, dev and test in local. After everything is fine, create merge request (MR) to dev branch.
  3. Other members will review your work and will accept/reject/ask for more work (in this case you have to work and test in local, then push to gitlab, no need to create MR becase it still there.
  4. After merge request is merged, it will be developed in test server and normally your branch will be deleted.
  5. If you found any bug, return to step 2.
  6. After testing and bug free, it will be merged to master branch.
  7. Type must be one of the following:
  • feat: A new feature
import threading
COUNT = 1000000
NUM_THREAD = 8
THREAD_RANGE = 125000
def print_num(start, end):
for i in range(start, end):
print(i)