This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from fastapi import FastAPI | |
import aioredis | |
app = FastAPI() | |
async def redis_pool(): | |
# Redis client bound to pool of connections (auto-reconnecting). | |
return aioredis.from_url( | |
"redis://localhost", encoding="utf-8", decode_responses=True | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto3 | |
import logging | |
logger = logging.getLogger('dag') | |
logger.setLevel(logging.INFO) | |
def get_url(bucket_name, obj): | |
return f"s3://{bucket}/{obj.key}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
#include <folly/ConcurrentSkipList.h> | |
static std::string makeRandomeString(int len) { | |
std::string s; | |
for (int j = 0; j < len; j++) { | |
s.push_back((rand() % 26) + 'A'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"crypto/rand" | |
"crypto/hmac" | |
"crypto/sha1" | |
"encoding/base32" | |
"time" | |
"fmt" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from thrift.protocol import TBinaryProtocol | |
from thrift.transport import TTransport | |
from schemas.singer.ttypes import LogMessage | |
fstream = open("./tf.log","rb") | |
transport = TTransport.TFramedTransport(TTransport.TFileObjectTransport(fstream)) | |
protocol = TBinaryProtocol.TBinaryProtocol(transport) | |
transport.open() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "rocksdb/db.h" | |
#include <iostream> | |
int main(int argc, char *argv[]) { | |
rocksdb::DB* db; | |
rocksdb::Options options; | |
options.create_if_missing = true; | |
rocksdb::Status status = rocksdb::DB::Open(options, argv[1], &db); | |
std::cout << status.ok() << std::endl; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DAG=$1 | |
START=$2 | |
END=$3 | |
run() { | |
CMD="airflow backfill $DAG -s $1" | |
$CMD | |
RET=$? | |
return $RET | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdint.h> | |
#include <stdio.h> | |
#include <map> | |
#include <vector> | |
#include <memory> | |
#include <type_traits> | |
#include <utility> | |
#include <iostream> | |
#include <chrono> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"strings" | |
"errors" | |
"crypto/hmac" | |
"crypto/sha256" | |
b64 "encoding/base64" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import boto3 | |
from datetime import datetime, timezone | |
Bucket = 'BUCKET_NAME' | |
client = boto3.client('s3') | |
#prefix = sys.argv[1] + "/" | |
Prefix = "" |
NewerOlder