Skip to content

Instantly share code, notes, and snippets.

View leobrines's full-sized avatar
👽

Leo leobrines

👽
View GitHub Profile
@leobrines
leobrines / grok_vi.mdown
Created July 20, 2023 23:45 — forked from nifl/grok_vi.mdown
Your problem with Vim is that you don't grok vi.

Answer by Jim Dennis on Stack Overflow question http://stackoverflow.com/questions/1218390/what-is-your-most-productive-shortcut-with-vim/1220118#1220118

Your problem with Vim is that you don't grok vi.

You mention cutting with yy and complain that you almost never want to cut whole lines. In fact programmers, editing source code, very often want to work on whole lines, ranges of lines and blocks of code. However, yy is only one of many way to yank text into the anonymous copy buffer (or "register" as it's called in vi).

The "Zen" of vi is that you're speaking a language. The initial y is a verb. The statement yy is a simple statement which is, essentially, an abbreviation for 0 y$:

0 go to the beginning of this line. y yank from here (up to where?)

@leobrines
leobrines / 1v1.cfg
Last active May 30, 2020 15:31
CFG for 1v1 in CS:GO
// CS:GO 1v1 AIM Config
exec gamemode_competitive.cfg
bot_quota "2" // Determines the total number of bots in the game
bot_quota_mode "fill" // Determines the total number of bots in the game
mp_buytime 0 // How many seconds after round start players can buy items for.
mp_do_warmup_period 0 // Whether or not to do a warmup period at the start of a match.
mp_free_armor 1 // Determines whether armor and helmet are given automatically.
@leobrines
leobrines / install-docker-wsl.sh
Last active April 29, 2020 17:37
Install docker on Windows Subsystem for Linux (execute as root)
# You must exec as root
# Sources:
# https://nickjanetakis.com/blog/setting-up-docker-for-windows-and-wsl-to-work-flawlessly
# https://nickjanetakis.com/blog/docker-tip-73-connecting-to-a-remote-docker-daemon
# https://medium.com/faun/docker-running-seamlessly-in-windows-subsystem-linux-6ef8412377aa
# https://medium.com/@sebagomez/installing-the-docker-client-on-ubuntus-windows-subsystem-for-linux-612b392a44c4
apt update
apt install apt-transport-https ca-certificates curl gnupg2 software-properties-common
@leobrines
leobrines / gpedit-install.bat
Created April 23, 2020 15:01
Activate gpedit on Windows
@echo off
pushd "%~dp0"
dir /b %SystemRoot%\servicing\Packages\Microsoft-Windows-GroupPolicy-ClientExtensions-Package~3*.mum >List.txt
dir /b %SystemRoot%\servicing\Packages\Microsoft-Windows-GroupPolicy-ClientTools-Package~3*.mum >>List.txt
for /f %%i in ('findstr /i . List.txt 2^>nul') do dism /online /norestart /add-package:"%SystemRoot%\servicing\Packages\%%i"
pause
@leobrines
leobrines / plugins.ini
Last active April 21, 2020 04:33
AMX 1.9 plugins for pugmod
; AMX Mod X plugins
; Admin Base - Always one has to be activated
admin.amxx ; admin base (required for any admin-related)
;admin_sql.amxx ; admin base - SQL version (comment admin.amxx)
; Basic
admincmd.amxx ; basic admin console commands
;adminhelp.amxx ; help command for admin console commands
;adminslots.amxx ; slot reservation
@leobrines
leobrines / autofastdl
Created April 4, 2020 20:01
Create a directory with fastdl files for cstrike server (Update 2k20)
#!/bin/bash
# SRCDS Server
# FastDL Creator
# Author : Robin Labadie aka UltimateByte
# Website : http://www.lrob.fr for http://www.mesnie.org
# Version : 1.2
# README
# This script is intended to work only for Valve SRCDS (Source) servers using Daniel Gibbs Linux Game Servers Management script
# It's been tested for Debian 8 but other debian and distros should also work
@leobrines
leobrines / sed.txt
Last active December 2, 2019 20:51
Syntax for refactor with new lines and multiple files in Mac OS with sed command
# Source: https://unix.stackexchange.com/questions/26284/how-can-i-use-sed-to-replace-a-multi-line-string
sed -e '1h;2,$H;$!d;g' -e 's/__YOUR_REGEX_GOES_HERE__...'
# Source: https://blog.stathat.com/2012/10/11/refactoring_with_sed.html
sed -i "" 's/uc.User.Data.ApiKey/uc.User.ApiKey()/g' **/*.go
@leobrines
leobrines / ngrok-install.sh
Created September 28, 2019 17:15
Install ngrok on Linux amd64 (https://ngrok.com/download)
#!/bin/bash
wget https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip
unzip ngrok-stable-linux-amd64.zip
rm ngrok-stable-linux-amd64.zip
chmod 755 ngrok
mv ngrok /usr/bin/
@leobrines
leobrines / gdrive_install.sh
Created September 9, 2019 01:19
Bash Script For Install Gdrive
#!/bin/bash
gdrive_name=gdrive
gdrive_bin=/usr/bin/$gdrive_name
if [ -f $gdrive_name ] ; then
echo "$gdrive_name already existe, probably it's installed..."
exit 0
else
echo "Downloading Google Drive | Script for Linux x64..."
@leobrines
leobrines / gdrive_install.sh
Created September 9, 2019 01:19
Bash Script For Install Gdrive
#!/bin/bash
gdrive_name=gdrive
gdrive_bin=/usr/bin/$gdrive_name
if [ -f $gdrive_name ] ; then
echo "$gdrive_name already existe, probably it's installed..."
exit 0
else
echo "Downloading Google Drive | Script for Linux x64..."