Skip to content

Instantly share code, notes, and snippets.

@sirdantas
sirdantas / docker-compose.yml
Created August 13, 2020 17:29
Kong + Konga
version: "3.7"
volumes:
kong_data: {}
networks:
kong-net:
services:
@danperrout
danperrout / TesouroDireto.gs
Last active April 1, 2025 14:37
API Função TESOURODIRETO Google Sheets
/*
* @return Acesse radaropcoes.com Retorna a cotação atual de um título específico do Tesouro Direto.
* Fonte: https://www.tesourodireto.com.br/titulos/precos-e-taxas.htm
**/
function TESOURODIRETO(bondName, argumento="r") {
let srcURL = "https://api.radaropcoes.com/bonds.json";
let jsondata = UrlFetchApp.fetch(srcURL);
let parsedData = JSON.parse(jsondata.getContentText()).response;
for(let bond of parsedData.TrsrBdTradgList) {
import { GoogleMapsAPIWrapper } from '@agm/core';
import { Directive, Output, EventEmitter } from '@angular/core';
declare var google: any;
@Directive({
selector: 'agm-location-marker'
})
export class AgmLocationMarker {
marker: any;
@sdgluck
sdgluck / query.js
Last active April 23, 2024 17:48
Pagination using Mongo: populate, match, sort, count, and limit with the aggregation pipeline
/**
* Query blog posts by user -> paginated results and a total count.
* @param userId {ObjectId} ID of user to retrieve blog posts for
* @param startRow {Number} First row to return in results
* @param endRow {Number} Last row to return in results
* @param [filter] {Object} Optional extra matching query object
* @param [sort] {Object} Optional sort query object
* @returns {Object} Object -> `{ rows, count }`
*/
function queryBlogPostsByUser (userId, startRow, endRow, filter = {}, sort = false) {
@CMCDragonkai
CMCDragonkai / http_streaming.md
Last active March 14, 2025 01:20
HTTP Streaming (or Chunked vs Store & Forward)

HTTP Streaming (or Chunked vs Store & Forward)

The standard way of understanding the HTTP protocol is via the request reply pattern. Each HTTP transaction consists of a finitely bounded HTTP request and a finitely bounded HTTP response.

However it's also possible for both parts of an HTTP 1.1 transaction to stream their possibly infinitely bounded data. The advantages is that the sender can send data that is beyond the sender's memory limit, and the receiver can act on