Skip to content

Instantly share code, notes, and snippets.

View mnabila's full-sized avatar
🏡
Working from home

M. Nabil Adani mnabila

🏡
Working from home
View GitHub Profile
@mnabila
mnabila / JetBrains trial reset.md
Created February 28, 2024 08:17 — forked from h3ssan/JetBrains trial reset.md
Reset all JetBrains products trial in Linux

In some cases, only these lines will work

for product in IntelliJIdea WebStorm DataGrip PhpStorm CLion PyCharm GoLand RubyMine; do
    rm -rf ~/.config/$product*/eval 2> /dev/null
    rm -rf ~/.config/JetBrains/$product*/eval 2> /dev/null
done

But if not, try these

@mnabila
mnabila / main.go
Created January 30, 2024 02:57
zerolog output to different file by level error
package main
import (
"fmt"
"io"
"os"
"time"
"github.com/rs/zerolog"
)
@mnabila
mnabila / main.go
Created November 30, 2022 12:58
sample using obj,MarshalJSON()
package main
import (
"encoding/json"
"fmt"
"time"
)
type JSONTime struct {
time.Time
@mnabila
mnabila / linux-usb-file-copy-fix.md
Created August 22, 2020 04:41 — forked from 2E0PGS/linux-usb-file-copy-fix.md
Fix Ubuntu and other Linux slow/hanging file copying via USB.

If your running a x64 bit Ubuntu or other Linux and find USB transfers hang at the end apply this fix:

echo $((16*1024*1024)) > /proc/sys/vm/dirty_background_bytes
echo $((48*1024*1024)) > /proc/sys/vm/dirty_bytes

I suggest you edit your /etc/rc.local file to make this change persistant across reboots.

sudo nano /etc/rc.local

@mnabila
mnabila / vim-plugin-directories
Created February 12, 2020 13:30 — forked from nelstrom/vim-plugin-directories
An overview of what belongs in each directory of a Vim plugin.
plugin
naming convention: name_of_plugin.vim
these files are sourced for all file types
doc
naming convention: name_of_plugin.txt
these files document the functionality of a plugin
color
naming convention: name_of_colorscheme.vim
@mnabila
mnabila / init.vim
Created February 4, 2020 14:23 — forked from danmikita/init.vim
File preview with FZF, RG, Bat, and Devicons
nnoremap <silent> <leader>e :call Fzf_dev()<CR>
" ripgrep
if executable('rg')
let $FZF_DEFAULT_COMMAND = 'rg --files --hidden --follow --glob "!.git/*"'
set grepprg=rg\ --vimgrep
command! -bang -nargs=* Find call fzf#vim#grep('rg --column --line-number --no-heading --fixed-strings --ignore-case --hidden --follow --glob "!.git/*" --color "always" '.shellescape(<q-args>).'| tr -d "\017"', 1, <bang>0)
endif
" Files + devicons
@mnabila
mnabila / .gitconfig
Created August 31, 2019 05:48 — forked from huytd/.gitconfig
Use neovim as diff tool
[merge]
tool = vimdiff
[mergetool]
prompt = true
[mergetool "vimdiff"]
cmd = nvim -d $LOCAL $REMOTE $MERGED -c '$wincmd w' -c 'wincmd J'
[difftool]
prompt = false
[diff]
tool = vimdiff
@mnabila
mnabila / .style.yapf
Created April 19, 2019 02:31 — forked from krnd/.style.yapf
(Python) yapf configuration file
# .style.yapf
#
# DESCRIPTION
# Configuration file for the python formatter yapf.
#
# This configuration is based on the generic
# configuration published on GitHub.
# (gist:krnd/.style.yapf)
#
# SEE ALSO
@mnabila
mnabila / config.py
Created January 30, 2019 11:39
flask config for xampp
class Config:
DEBUG = True
SQLALCHEMY_DATABASE_URI = "mysql+pymysql://username:password@127.0.0.1:3306/database?unix_socket=/opt/lampp/var/mysql/mysql.sock"
SECRET_KEY = "ada"
@mnabila
mnabila / LICENCE SUBLIME TEXT
Created December 14, 2018 18:34
Sublime Text 3 Serial key build is 3176
## Sublime Text 3 Serial key build is 3176
> * Added these lines into /etc/hosts
127.0.0.1 www.sublimetext.com
127.0.0.1 license.sublimehq.com
> * Used the license key
----- BEGIN LICENSE -----