Skip to content

Instantly share code, notes, and snippets.

View enzzc's full-sized avatar
🙃
Focusing

Luciano C. enzzc

🙃
Focusing
View GitHub Profile
@enzzc
enzzc / init.lua
Last active February 5, 2024 09:03
neovim conf
vim.opt.number = true
vim.opt.relativenumber = true
vim.o.tabstop = 4
vim.o.expandtab = true
vim.o.softtabstop = 4 -- Number of spaces inserted instead of a TAB character
vim.o.shiftwidth = 4 -- Number of spaces inserted when indenting
vim.cmd 'autocmd Filetype javascript setlocal ts=2 sw=2 sts=0 expandtab'
vim.cmd 'autocmd Filetype typescript setlocal ts=2 sw=2 sts=0 expandtab'
vim.cmd 'autocmd Filetype json setlocal ts=2 sw=2 sts=0 expandtab'
#define DATA_PIN 7
#define CLOCK_PIN 12
#define LATCH_PIN 9
uint8_t k = 0;
float speed_msecs = 0;
int lum = 0;
void setup() {
pinMode(DATA_PIN, OUTPUT);
from collections import defaultdict
def reverse_table(deps):
table = defaultdict(list)
for label, deps in deps.items():
for d in deps:
table[d].append(label)
return table
def delete_duplicates(xs):
import re
import requests
_Router = {
}
def select(req):
for regex, func in _Router.items():
if re.match(regex, req):
try:
from flask import Flask, request, abort
import json
import rules
from linebot import (
LineBotApi, WebhookHandler
)
from linebot.exceptions import (
InvalidSignatureError
@enzzc
enzzc / sqs_aiobotocore.py
Created June 30, 2019 14:40
Simple example using AWS SQS with aiobotocore
import pathlib
import json
import asyncio
import aiobotocore
import time
import uuid
def message(msg):
return json.dumps({
@enzzc
enzzc / auth_dns_serve.py
Created June 16, 2019 08:00
A simple authoritative DNS server which returns the same answer for all questions
import time
import socket
import select
import sqlite3
import dns.message
import dns.exception
DNS_SERVER_PORT = 53
IP4_ADDR = '0.0.0.0' # IPv4 address to return
IP6_ADDR = '::' # IPv6 address to return (if you want to support IPv6)
from functools import reduce
from collections import defaultdict
class IndexBackend:
def index_document(self, doc_id, text):
raise NotImplementedError
def search(self, query):
raise NotImplementedError

Keybase proof

I hereby claim:

  • I am enzzc on github.

  • I am enz (https://keybase.io/enz) on keybase.

  • I have a public key ASCUuC60gFpVmQqWkDPWa0P3mGfVrl39xE1zQ3ae5OwcKQo

import requests
base_url = 'https://zestedesavoir.com'
endpoint = 'https://zestedesavoir.com/api/membres?page_size=1000'
endpoint_user = 'https://zestedesavoir.com/api/membres/{user_id}/'
r = requests.get(endpoint)
res = r.json()['results']
suspicious = [