Skip to content

Instantly share code, notes, and snippets.

View sardor01's full-sized avatar

Sardor Astanov sardor01

View GitHub Profile
@Anoesj
Anoesj / object-path.js
Last active August 14, 2025 01:50
Get value by object path
// LONG VERSION WITH ERROR LOGGING
function getValueByObjectPath (obj, path) {
const pathSplit = path.split('.');
return pathSplit.reduce((value, pathPart, depth) => {
try {
return value[pathPart];
}
catch (err) {
let pathSoFar = '';
for (let i = 0; i < depth; i++) {
@Rich-Harris
Rich-Harris / what-is-svelte.md
Last active November 13, 2025 01:35
The truth about Svelte

I've been deceiving you all. I had you believe that Svelte was a UI framework — unlike React and Vue etc, because it shifts work out of the client and into the compiler, but a framework nonetheless.

But that's not exactly accurate. In my defense, I didn't realise it myself until very recently. But with Svelte 3 around the corner, it's time to come clean about what Svelte really is.

Svelte is a language.

Specifically, Svelte is an attempt to answer a question that many people have asked, and a few have answered: what would it look like if we had a language for describing reactive user interfaces?

A few projects that have answered this question:

@faim87
faim87 / Uzbekistan_phone_codes_regex_pattern.md
Last active October 20, 2025 05:23
Uzbekistan phone codes - regex pattern.

Mobile = /^9989[012345789][0-9]{7}$/

All = /^998(9[012345789]|6[125679]|7[01234569])[0-9]{7}$/

@craigbeck
craigbeck / introspection-query.graphql
Created April 6, 2016 20:20
Introspection query for GraphQL
query IntrospectionQuery {
__schema {
queryType { name }
mutationType { name }
subscriptionType { name }
types {
...FullType
}
directives {