Skip to content

Instantly share code, notes, and snippets.

View dgrr's full-sized avatar

Darío dgrr

  • Infinite Field
  • Dubai
  • 09:18 (UTC +04:00)
View GitHub Profile
#include <iostream>
#include <pqxx/pqxx>
#include <string>
#include <string>
template<size_t I, class It, class T, class Tuple>
std::enable_if_t<(I == std::tuple_size<Tuple>::value - 1)> assign(It it, It end, T& v, Tuple& tp)
{
if (it == end)
return;
#include <immintrin.h>
#include <string>
static const unsigned char __hex_chars[16] = {'0', '1', '2', '3', '4', '5',
'6', '7', '8', '9', 'a', 'b',
'c', 'd', 'e', 'f'};
static const unsigned char __blend_table[32] = {
0, 128, 0, 128, 0, 128, 0, 128, 0, 128, 0, 128, 0, 128, 0, 128,
0, 128, 0, 128, 0, 128, 0, 128, 0, 128, 0, 128, 0, 128, 0, 128};
static const unsigned char __dup_index[16] = {0, 0, 1, 1, 2, 2, 3, 3,
@dgrr
dgrr / quickxml_233MB.go
Created April 21, 2020 20:24
QuickXML processing a 233MB XML file.
package main
import (
"fmt"
"log"
"os"
"runtime"
"strings"
xml "github.com/dgrr/quickxml"
@dgrr
dgrr / fasthttp_auth_client.go
Last active January 9, 2023 18:46
HTTP client-side Basic HTTP Authentication
package main
import (
"encoding/base64"
"fmt"
"log"
"os"
"github.com/valyala/fasthttp"
)
@dgrr
dgrr / fasthttp_auth.go
Last active July 30, 2024 17:59
HTTP server-side Basic Authentication using fasthttp
package main
import (
"bytes"
"encoding/base64"
"fmt"
"log"
"github.com/valyala/fasthttp"
)
@dgrr
dgrr / sshfs_umount_atexit.sh
Last active March 29, 2019 15:59
Bash code to umount sshfs when exiting the bash session. Just add the code to your .bashrc.
# I am not a bash scripting expert. Sorry xd
sshfs_dirs=()
clean_sshfs_dirs() {
local var mountpoints=()
for i in `df -h|awk -F' ' '{split($6,a,"\n"); print a[1]}'`; do
mountpoints+=("$i")
done