Skip to content

Instantly share code, notes, and snippets.

View SergioRibera's full-sized avatar
🦀

Sergio Alejandro Ribera Costa SergioRibera

🦀
View GitHub Profile
@stifskere
stifskere / chrome-80-and-same-site-cookies.md
Last active January 17, 2025 13:58
Chrome 80 and Same-Site cookies

Chrome 80 and Same-Site cookies

Since the release of the Chrome 80 update, working with cookies became more difficult, from developing in localhost environments, to always requiring secure contexts.

I was developing a project of my own for an enterprise I have with a partner, we were developing both front-end and back-end. The back-end was already done, all we were missing was the front-end, but when we assumed everything was working we tried the dev release and the login button was actually successful, but we were being redirected back at login.

What happened?

@numToStr
numToStr / au.lua
Last active August 20, 2023 05:15
Neovim autocmd in lua
--
-- Move this file to your neovim lua runtime path ie. ~/.config/nvim/lua/au.lua
--
local cmd = vim.api.nvim_command
local function autocmd(this, event, spec)
local is_table = type(spec) == 'table'
local pattern = is_table and spec[1] or '*'
local action = is_table and spec[2] or spec
if type(action) == 'function' then
@r0mdau
r0mdau / README.md
Last active January 19, 2025 22:05
Rust Actix vs Rust Hyper vs Go fasthttp vs Go net/http httprouter

Load tests

Injector

wrk is the binary used as injector, always used with these options:

./wrk -t12 -c1000 -d15s http://127.0.0.1:8080/

Results

@Klerith
Klerith / git-alias.md
Last active May 5, 2025 02:23
Useful Git Alias

Log

git config --global alias.lg "log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all"

Status

git config --global alias.s status --short

Alternativa útil de status

git config --global alias.s status -sb

@saisasidhar
saisasidhar / eos_as_videofeed.md
Created December 1, 2020 15:32
Canon EOS as video feed in Arch Linux
➜ uname -r
# get installed kernel version
➜ pacman -S linux-headers
# select kernel version
@Technius
Technius / main.rs
Created April 22, 2019 23:57
Asynchronous process I/O in Rust using tokio
// This code sample needs the dependencies:
// tokio = "0.1"
// tokio-process = "0.2"
use tokio::prelude::*;
use std::process::{Command, Stdio};
use tokio_process::CommandExt;
use std::time::Duration;
fn main() {
@bojanrajkovic
bojanrajkovic / option.cs
Last active March 14, 2024 20:13
Quick and dirty Rust-like Option<T> in C#. Basically untested, use at your own risk!
public static class Option
{
public static Option<T> None<T>() => new None<T>();
public static Option<T> Some<T>(T value) => new Some<T>(value);
}
public class Option<T> : IEquatable<Option<T>>
{
public static Option<T> None => new None<T>();
public bool IsNone => !hasValue;
@thacoon
thacoon / arch-linux-gnome-install
Last active March 22, 2025 06:30
Install a minimal gnome setup and some more useful things
# Install Gnome and some other useful thins
# The official installation guide (https://wiki.archlinux.org/index.php/Installation_Guide) contains a more verbose description.
# And based on https://wiki.archlinux.de/title/Anleitung_f%C3%BCr_Einsteiger
# I have just copied commands from https://wiki.archlinux.de/title/Anleitung_f%C3%BCr_Einsteiger#Weitere_notwendige_Dienste
# It's just to have it with one view after doing a [fresh installation](https://gist.github.com/thacoon/05d5a39606ab554455d6713e8a714b2c)
# Some useful services
pacman -S acpid ntp dbus cups cronie
@GabLeRoux
GabLeRoux / archlinux-virtualbox.sh
Last active November 27, 2023 12:22
Virtualbox archlinux notes
# sudo /sbin/rcvboxdrv -h
# Unloading modules:
# Loading modules: modprobe: FATAL: Module vboxnetadp not found in directory /lib/modules/4.4.3-1-ARCH
# modprobe: FATAL: Module vboxnetflt not found in directory /lib/modules/4.4.3-1-ARCH
# modprobe: FATAL: Module vboxpci not found in directory /lib/modules/4.4.3-1-ARCH
# modprobe: FATAL: Module vboxdrv not found in directory /lib/modules/4.4.3-1-ARCH
# Solution
# from https://forum.antergos.com/topic/818/can-t-run-my-vitualbox/4