Skip to content

Instantly share code, notes, and snippets.

View alrocar's full-sized avatar

alrocar alrocar

View GitHub Profile
[{"id":61408130,"description":"Install GitLab Runner, configure Docker as Executor, set up cicd, deploy applications to k8s and much more.","name":"gitlab-cicd-demo","name_with_namespace":"somesh-B / gitlab-cicd-demo","path":"Jenkins-Zero-To-Hero","path_with_namespace":"somesh-B/Jenkins-Zero-To-Hero","created_at":"2024-09-04T14:30:12.294Z","default_branch":"main","tag_list":[],"topics":[],"ssh_url_to_repo":"[email protected]:somesh-B/Jenkins-Zero-To-Hero.git","http_url_to_repo":"https://gitlab.com/somesh-B/Jenkins-Zero-To-Hero.git","web_url":"https://gitlab.com/somesh-B/Jenkins-Zero-To-Hero","readme_url":"https://gitlab.com/somesh-B/Jenkins-Zero-To-Hero/-/blob/main/README.md","forks_count":0,"avatar_url":null,"star_count":0,"last_activity_at":"2024-09-04T14:30:12.224Z","namespace":{"id":92865740,"name":"somesh-B","path":"somesh-B","kind":"user","full_path":"somesh-B","parent_id":null,"avatar_url":"https://secure.gravatar.com/avatar/cd49a0187e692f3f7858282e62765727221c8764ed730621d20470668278cfbf?s=80\u0026d=iden
-- run it with: cat usain_bolt.sql | clickohuse-client -mn
drop database deleteme_alrocar;
create database deleteme_alrocar;
CREATE TABLE deleteme_alrocar.deleteme
(
`number` UInt64,
`key` LowCardinality(String),
`timestamp` DateTime
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
"[#*0-9]\x{FE0F}?\x{20E3}|\x{A9}\x{FE0F}?|[\x{AE}\x{203C}\x{2049}\x{2122}\x{2139}\x{2194}-\x{2199}\x{21A9}\x{21AA}]\x{FE0F}?|[\x{231A}\x{231B}]|[\x{2328}\x{23CF}]\x{FE0F}?|[\x{23E9}-\x{23EC}]|[\x{23ED}-\x{23EF}]\x{FE0F}?|\x{23F0}|[\x{23F1}\x{23F2}]\x{FE0F}?|\x{23F3}|[\x{23F8}-\x{23FA}\x{24C2}\x{25AA}\x{25AB}\x{25B6}\x{25C0}\x{25FB}\x{25FC}]\x{FE0F}?|[\x{25FD}\x{25FE}]|[\x{2600}-\x{2604}\x{260E}\x{2611}]\x{FE0F}?|[\x{2614}\x{2615}]|\x{2618}\x{FE0F}?|\x{261D}[\x{FE0F}\x{1F3FB}-\x{1F3FF}]?|[\x{2620}\x{2622}\x{2623}\x{2626}\x{262A}\x{262E}\x{262F}\x{2638}-\x{263A}\x{2640}\x{2642}]\x{FE0F}?|[\x{2648}-\x{2653}]|[\x{265F}\x{2660}\x{2663}\x{2665}\x{2666}\x{2668}\x{267B}\x{267E}]\x{FE0F}?|\x{267F}|\x{2692}\x{FE0F}?|\x{2693}|[\x{2694}-\x{2697}\x{2699}\x{269B}\x{269C}\x{26A0}]\x{FE0F}?|\x{26A1}|\x{26A7}\x{FE0F}?|[\x{26AA}\x{26AB}]|[\x{26B0}\x{26B1}]\x{FE0F}?|[\x{26BD}\x{26BE}\x{26C4}\x{26C5}]|\x{26C8}\x{FE0F}?|\x{26CE}|[\x{26CF}\x{26D1}\x{26D3}]\x{FE0F}?|\x{26D4}|\x{26E9}\x{FE0F}?|\x{26EA}|[\x{26F0}\x{26F1}]\x{FE0F}?|[\
@alrocar
alrocar / clickhouse_to_markdown.md
Last active August 15, 2022 01:00
Export from ClickHouse to Markdown table

SQL

SELECT
  number a,
  number + 1 b,
  number + 2 c
FROM numbers(100) INTO OUTFILE '/tmp/tt.md'
FORMAT Template
SETTINGS
@alrocar
alrocar / anomaly_detection.pipe
Created June 22, 2021 17:06
Z-score based anomaly detection
NODE context
DESCRIPTION >
Based on https://blog.tinybird.co/2021/06/24/anomaly-detection/
SQL >
%
SELECT
sum(qty) qty,
toStartOfInterval(utc_date, INTERVAL {{Int32(interval_duration, 10)}} second) date
FROM
@alrocar
alrocar / ingest_from_array.py
Created July 20, 2020 16:07
Ingest to Tinybird from a Python array
import csv
import requests
from io import StringIO
from requests.adapters import HTTPAdapter
from urllib3.util.retry import Retry
rows = [[1, 2, 3], [4, 5, 6]]
endpoint = 'https://api.tinybird.co'
@alrocar
alrocar / kuviz.html
Last active December 26, 2019 11:25
<iframe src="https://public.carto.com/kuviz/f8dcf0ef-45e5-4578-a245-af443c870ffa" height="600" width="600" />
<iframe src="https://www.youtube.com/embed/enMumwvLAug" frameborder="0" allowfullscreen="true"> </iframe>
#!/usr/bin/env python
from __future__ import print_function
from math import log, tan, pi
from itertools import product
from argparse import ArgumentParser
from os.path import join, splitext
import tempfile, shutil, urllib, io, sys, subprocess
tile_url = 'https://elevation-tiles-prod.s3.amazonaws.com/geotiff/{z}/{x}/{y}.tif'
import os
import sys
import argparse
from carto.auth import APIKeyAuthClient
from carto.maps import NamedMapManager
parser = argparse.ArgumentParser(description=(
'Example of CopySQLClient usage to stream data from NEXRAD Level 2'
import os
import sys
import argparse
try:
from urllib2 import urlopen
except ImportError:
from urllib.request import urlopen
try:
from StringIO import BytesIO