Skip to content

Instantly share code, notes, and snippets.

@prantor19
prantor19 / Get all files exept lates 3 files from each subdirectories
Last active January 3, 2021 12:55
Get all files exept lates 3 files from each subdirectories
find `pwd` -type d | xargs -I{} echo '"{}"' | tail -n+2 | sed "s/^\(.*\)/find \1 -type f -printf '%T@ %p\n' | sort -nr | tail -n+4 /e" | sed '/^$/d' | cut -d" " -f2-
Source: https://gitter.im/syl20bnr/spacemacs?at=5b45e03a60c38707837070b0
Ljupcho Kotev @ljupchokotev 12:47
It's best to use the xclip package
it works flawlessly
Add xclip to dotspacemacs-additional-packages and then (xclip-mode 1) in user-config
all copy/paste will work between terminal/spacemacs/gui/etc
you just need to have xclip installed, which probably already is
@prantor19
prantor19 / gist:3a52b14ca834367b2511defa30a8fc8b
Created September 24, 2020 16:49
Termux exersism install
pkg install -y golang && pkg install -y git && go get github.com/exercism/cli/exercism && echo 'export PATH=$PATH:$HOME/go/bin' >> ~/.profile && source ~/.profile
@prantor19
prantor19 / 51-android.rules
Created May 24, 2020 16:54
adb no permission
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4ee7", MODE="0660", GROUP="arif", SYMLINK+="android%n"
@prantor19
prantor19 / Eloquent query builder export sql.php
Created March 11, 2020 11:23
Eloquent query builder export sql
$sql = vsprintf(str_replace(array('?'), array('\'%s\''), $query->toSql()), $query->getBindings());
@prantor19
prantor19 / docker commands
Last active February 14, 2020 06:32
Common Docker Command
list image:
docker image ls
docker images
list including unnamed image:
docker image ls -a
docker images -a
list running container:
docker ps
list all container:
docker ps -a
@prantor19
prantor19 / docker cgroup mountpoint
Last active February 14, 2020 03:52
Temp fix for docker: Error response from daemon: cgroups: cgroup mountpoint does not exist: unknown.
sudo mkdir /sys/fs/cgroup/systemd && sudo mount -t cgroup -o none,name=systemd cgroup /sys/fs/cgroup/systemd
@prantor19
prantor19 / Php-fpm apache
Last active March 14, 2020 05:36
php-fpm apache
Enable file write
sudo chcon -R -t httpd_sys_rw_content_t /var/www/html
@prantor19
prantor19 / Absolute path ReactJs using vscode
Last active January 6, 2020 12:15
Absolute path ReactJs using vscode
I mapped my src directory to ~ so I can access all my top folders like this :
import DB from '~/lib/database'
import { User } from '~/domain/user'
1. Teach VS Code's Intellisense where to look at
So you can jump to the definition and have autocompletion. ✨
To do that, create a jsconfig.json file at the root of your project :
{
SELECT
wp_users.*,
name.meta_value as shop_name,
lat.meta_value as lat,
lng.meta_value as lng,
(select (6371 * acos(
cos( radians('23.9907537') )
* cos( radians( lat ) )