Skip to content

Instantly share code, notes, and snippets.

View ramubotsplash's full-sized avatar

Ramu Pulipati ramubotsplash

View GitHub Profile
@andrewchilds
andrewchilds / deepGet.js
Last active July 8, 2024 14:15 — forked from harish2704/lodash.get.js
Simple, standalone, vanilla implementation of lodash.get
// Simple implementation of lodash.get
// Handles arrays, objects, and any nested combination of the two.
// Also handles undefined as a valid value - see test case for details.
// Based on: https://gist.github.com/harish2704/d0ee530e6ee75bad6fd30c98e5ad9dab
export function deepGet(obj, query, defaultVal) {
query = Array.isArray(query) ? query : query.replace(/(\[(\d)\])/g, '.$2').replace(/^\./, '').split('.');
if (!(query[0] in obj)) {
return defaultVal;
}
obj = obj[query[0]];
@fabiolimace
fabiolimace / ksuid.sql
Last active July 10, 2024 19:00
Functions for generating Segment's KSUIDs on PostgreSQL
/*
* MIT License
*
* Copyright (c) 2023 Fabio Lima
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
@shved
shved / clickhouse-cheatsheet.md
Last active May 26, 2024 11:02
ClickHouse client cheatsheet

Cheatseet assumes you're just playing around on a not clustered ClickHouse server.

docker run -it yandex/clickhouse-client --host your.toy.server.host --port 9500 --user default --password password123 --multiline

SHOW DATABASES

SHOW TABLES (in current database)

SHOW DICTIONARIES (in current database)

@LucGranato
LucGranato / index.html
Last active November 1, 2023 00:39
Monaco Editor Liquid Language
<div id="container" style="height:100%;"></div>
@ruanbekker
ruanbekker / cheatsheet-elasticsearch.md
Last active April 24, 2024 00:11
Elasticsearch Cheatsheet : Example API usage of using Elasticsearch with curl
@brandonmwest
brandonmwest / example.cs
Last active June 27, 2024 04:03
Generating base64-encoded Authorization headers in a variety of languages
httpClient.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue(
"Basic",
Convert.ToBase64String(
System.Text.ASCIIEncoding.ASCII.GetBytes(
string.Format("{0}:{1}", username, password))));