Skip to content

Instantly share code, notes, and snippets.

@Zmetser
Zmetser / appThreadPage.graphql
Created February 28, 2024 08:12
AppThreadPage thread query error
query AppThreadPage {
appThreadPage(uuid: "5a266409-d835-4e27-956a-569e63f553b6") {
users { name }
related_to_block { uuid }
threads {
single_block_exchange { uuid }
thread { uuid }
@Zmetser
Zmetser / TheScreen.graphql
Created February 16, 2024 16:09
Example query we're planning to do for the new Everything Page
query TheScreen {
theScreen(nodeId: String) { # this is the junction block id or the root thread id
# this is the junction block
# NULL if the thread is a root thread
related_to_block {
uuid
created_by {}
content
}
let sum = 0
for (let i = 0; i < input.length; i++) {
const [_, s1, e1, s2, e2] = /(\d{1,2})-(\d{1,2}),(\d{1,2})-(\d{1,2})/g.exec(input[i])
const series1 = Array(Number(e1) - Number(s1) + 1).fill(0).map((_, i) => i + Number(s1))
const series2 = Array(Number(e2) - Number(s2) + 1).fill(0).map((_, i) => i + Number(s2))
if (series1.length > series2.length) {
sum += series2.every(n => series1.includes(n)) ? 1 : 0 // some for 2nd part
} else {
sum += series1.every(n => series2.includes(n)) ? 1 : 0 // some for 2nd part
@Zmetser
Zmetser / input.scss
Created April 30, 2022 08:36
Generated by SassMeister.com.
@use "sass:map"; // include { map } from 'sass/map';
@use "sass:list"; // include { list } from 'sass/list';
// Lists
// 16px 24px 32px 64px
$icons: 16, 24, 32, 64, 128, 512; // JS tomb [16px, 24px]
// array.foreach(size => ...)
@each $size in $icons {
.icon-#{$size} {
@Zmetser
Zmetser / input.scss
Created April 30, 2022 07:59
Generated by SassMeister.com.
// https://sass-lang.com/
// Preprocessing
/*************
* Variables *
*************/
$base-color: #bada55; // nincs kulonbseg a - es _ kozott $base_color == $base-color
$string: "";
$border-dark: rgba($base_color, 0.8);
@Zmetser
Zmetser / input.scss
Created April 29, 2022 09:59
Generated by SassMeister.com.
// https://sass-lang.com/
// Preprocessing
/*************
* Variables *
*************/
$base-color: #c6538c; // nincs kulonbseg a - es _ kozott $base_color == $base-color
$border-dark: rgba($base_color, 0.88);
@Zmetser
Zmetser / amp-ima-video.html
Created April 23, 2020 11:17
The parent tag of tag 'audio > track' is 'track', but it can only be 'audio'.
<!doctype html>
<html ⚡>
<head>
<meta charset="utf-8">
<link rel="canonical" href="self.html" />
<meta name="viewport" content="width=device-width,minimum-scale=1">
<style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript>
<script async="" custom-element="amp-ima-video" src="https://cdn.ampproject.org/v0/am
/* @flow */
type Slide = {| id: number |}
class Test {
slidesWithAds: Array<Slide> = [{id: 2}];
getNonAdSlideIndex(indexWithAds: number): ?Slide {
return this.slidesWithAds[indexWithAds];
}
}
/* @flow */
type Slide = {| id: number |}
class Test {
slidesWithAds: Array<Slide> = [{id: 2}, {id: 4}];
getNonAdSlideIndex(indexWithAds: number): ?Slide {
return this.slidesWithAds[indexWithAds];
}
}
/* @flow */
type Slide = {| id: number |}
class Test {
slidesWithAds: Array<Slide> = [{id: 2}, {id: 4}];
getNonAdSlideIndex(indexWithAds: number): ?Slide {
return this.slidesWithAds[indexWithAds];
}
}