Skip to content

Instantly share code, notes, and snippets.

View nitely's full-sized avatar
🟢
online

Esteban C Borsani nitely

🟢
online
View GitHub Profile
@nitely
nitely / pipelining.md
Created October 29, 2024 01:33
HTTP pipelining pros and cons

HTTP pipelining pros and cons

Pros

  • Client sends all requests without waiting for the server responses.
  • This saves at least one roundtrip since the server no longer needs to wait for the client to receive the response in order to get the next request.
  • Client does less OS calls to send the requests, as it can concatenate them.
  • Server can process all requests at the same time, saving total latency time for all requests and responses combined.
  • Even if the server does not support pipelining, the client sending all requests combined still saves up to N half-roundtrips. Where N is the number of requests.
@WebReflection
WebReflection / custom-elements-pattern.md
Last active April 29, 2025 19:25
Handy Custom Elements' Patterns

Handy Custom Elements' Patterns

Ricardo Gomez Angel Photo by Ricardo Gomez Angel on Unsplash

This gist is a collection of common patterns I've personally used here and there with Custom Elements.

These patterns are all basic suggestions that could be improved, enriched, readapted, accordingly with your needs.

@nitely
nitely / unicodenames.md
Last active September 16, 2017 06:23
How Python's unicodedata (unicodenames) works

Fredrik Lundh's unicodenames

From: "Fredrik Lundh" [email protected] Date: Sun, 16 Jul 2000 20:40:46 +0200

The unicodenames database consists of two parts: a name database which maps character codes to names, and a code database, mapping names to codes.

  • The Name Database (getname)
@nitely
nitely / scanner.py
Created March 30, 2017 05:39
Python re.Scanner (almost) without using internals
import sre_compile
import re
class Scanner:
def __init__(self, rules, flags=0):
self.scanner = sre_compile.compile(
'(%s)' % '|'.join('(%s)' % pattern for pattern in rules),
flags)
@zacharycarter
zacharycarter / wclwn.md
Last active May 22, 2025 15:00
Binding to C Libraries with Nim
@humitos
humitos / spotify-noads.py
Last active February 21, 2021 03:12
Remove Ads from Spotify Linux client by mutting the audio system
# -*- coding: utf-8 -*-
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@gaearon
gaearon / connect.js
Last active May 3, 2025 05:27
connect.js explained
// connect() is a function that injects Redux-related props into your component.
// You can inject data and callbacks that change that data by dispatching actions.
function connect(mapStateToProps, mapDispatchToProps) {
// It lets us inject component as the last step so people can use it as a decorator.
// Generally you don't need to worry about it.
return function (WrappedComponent) {
// It returns a component
return class extends React.Component {
render() {
return (
@estesp
estesp / user-ns.md
Last active April 2, 2020 17:10
User namespace proposed docs

Experimental user namespace support

Linux kernel user namespace support provides additional security by enabling a process--and therefore a container--to have a unique range of user and group IDs which are outside the traditional user and group range utilized by the host system. Potentially the most important security improvement is that, by default, container processes running as the root user will have expected administrative privilege (with some restrictions) inside the container but will effectively be mapped to an unprivileged uid on the host.

@juancarlospaco
juancarlospaco / qpdf.py
Last active April 6, 2018 19:35
PDF Conversor powered by Qt5, does NOT show up any GUI, just needs an URL string, then it Prints PDF, and returns file path string, uses UUID if no output filename is passed, optional Landscape orientation if supported, CSS3 Just Works!.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""PDF Conversor powered by Qt5."""
from uuid import uuid4
from PyQt5.QtCore import QUrl
@samwgoldman
samwgoldman / example.js
Last active April 3, 2021 22:20
Pure, stateless, type-checked React components with Immutable.js and Flow
/* @flow */
var React = require("react")
var Immutable = require("immutable")
// In order to use any type as props, including Immutable objects, we
// wrap our prop type as the sole "data" key passed as props.
type Component<P> = ReactClass<{},{ data: P },{}>
type Element = ReactElement<any, any, any>