Skip to content

Instantly share code, notes, and snippets.

View lopesivan's full-sized avatar
🚧
Working from home

Mr. Ivan lopesivan

🚧
Working from home
View GitHub Profile
@lopesivan
lopesivan / csharpier.lua
Created November 7, 2023 20:16
after/plugin/csharpier.lua
if vim.fn.executable "dotnet-csharpier" == 0 then
return
end
local group = vim.api.nvim_create_augroup("CsharpierAuto", { clear = true })
vim.api.nvim_create_autocmd("BufWritePost", {
group = group,
pattern = { "*.cs" },
callback = function()
#include <stdio.h>
struct speed {
int x;
int y;
};
void aumenta(struct speed *speed);
void aumenta(struct speed *speed){
@lopesivan
lopesivan / entrypoint.sh
Created July 18, 2022 06:43
Docker no-root engine
#!/bin/bash
if [ -z "$GID" -o -z "$UID" -o -z "$USER" -o -z "$GROUP" ]; then
echo Running as root
exec "$@"
else
if [ ! $(getent group $GROUP) -a ! $(getent group $GID) ]; then
echo Creating group $GROUP with id $GID
groupadd -g $GID $GROUP
else
echo Group name $GROUP or id $GID already exist
@lopesivan
lopesivan / entrypoint.sh
Created July 18, 2022 06:06
Docker no-root engine
#!/bin/bash
if [ -z "$GID" -o -z "$UID" -o -z "$USER" -o -z "$GROUP" ]; then
echo Running as root
exec "$@"
else
if [ ! $(getent group $GROUP) -a ! $(getent group $GID) ]; then
echo Creating group $GROUP with id $GID
groupadd -g $GID $GROUP
else
echo Group name $GROUP or id $GID already exist
@lopesivan
lopesivan / dropchrome
Created May 18, 2022 02:26
i3wm hide/show google-chrome
#!/bin/sh
if xwininfo -tree -root | grep -q "chrome"
then
echo "Window detected."
if xdo id -a "Google Chrome" >&- 2>&-;
then
map_state=$(xwininfo -all -id `xdo id -a "Google Chrome"` | grep "Map State"| cut -d\s -f2)
@lopesivan
lopesivan / dropqutebroser
Created May 18, 2022 02:26
i3wm hide/show qutebrowser
#!/bin/sh
if xwininfo -tree -root | grep "qutebrowser";
then
echo "Window detected."
map_state=`xwininfo -all -id $(xdo id -N qutebrowser) | grep "Map State"| cut -d\s -f2`
# if [ "$map_state" = 'UnMapped' ];
if [ "$map_state" = 'Viewable' ];
then
@lopesivan
lopesivan / dropchrome
Created May 18, 2022 02:23
i3wm hide/show google-chrome
#!/bin/sh
if xwininfo -tree -root | grep -q "chrome"
then
echo "Window detected."
if xdo id -a "Google Chrome" >&- 2>&-;
then
echo 111111
@lopesivan
lopesivan / dropqutebroser
Created May 18, 2022 02:22
i3wm hide/show qutebrowser
#!/bin/sh
if xwininfo -tree -root | grep "qutebrowser";
then
echo "Window detected."
map_state=`xwininfo -all -id $(xdo id -N qutebrowser) | grep "Map State"| cut -d\s -f2`
if [ "$map_state" = 'Viewable' ];
then
echo "Window detected."

// terminal 1

$ echo 'int main() { pause(); }' > main.c && clang -Wno-implicit-function-declaration && ./a.out

// terminal 2

$ exec 5<>$(lsof -g $(pgrep a.out) | grep pts | head -1 | awk ' { print $10 }')
$ lldb <&5 1>&5 2>&5
" abreviação
" modo de inserção
" input: key[Space]
" output: import pandas as pd
" ^
" |
" + - cursor aqui
"
func Eatchar(pat)
let c = nr2char(getchar(0))