Skip to content

Instantly share code, notes, and snippets.

View ezze's full-sized avatar
💭
Back to the heavyweight jam

Dmitriy Pushkov ezze

💭
Back to the heavyweight jam
View GitHub Profile
@ezze
ezze / date-time.ts
Last active November 23, 2023 21:23
Custom scope data resolver for easy-template-x with extensions and angular expressions support
import dayjs from 'dayjs';
import 'dayjs/locale/ru';
import { TemplateData } from 'easy-template-x';
import { TemplateResolverError } from './resolver';
import { TemplateResolvedValue } from './types';
type DateTimeOptions = {
format?: string;
};
@ezze
ezze / loop-list-strategy.ts
Created November 23, 2023 20:23
Possible easy-template-x fix with multiple conditions nested in a table
import { PluginUtilities, Tag, XmlNode } from 'easy-template-x';
import { ILoopStrategy, SplitBeforeResult } from './types';
export class LoopListStrategy implements ILoopStrategy {
private utilities: PluginUtilities | undefined;
public setUtilities(utilities: PluginUtilities): void {
this.utilities = utilities;
}
@ezze
ezze / scratch-3-desktop-linux.md
Last active July 8, 2021 09:25
Build Scratch 3 desktop application for Linux

In order to build Scratch 3 desktop application for Linux execute commands below.

  1. Install Git and Node.js (the easiest way to install Node.js is to use nvm). This is how it can be done in Ubuntu 20.04:

    sudo apt install -y git
    wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
    source ~/.bashrc
    nvm install --lts=fermium
    
@ezze
ezze / russia.json
Created August 5, 2019 20:30
Russia GeoJson
{
"type": "Feature",
"properties": {
"featurecla": "Admin-0 country",
"scalerank": 5,
"LABELRANK": 2,
"SOVEREIGNT": "Russia",
"SOV_A3": "RUS",
"ADM0_DIF": 0,
"LEVEL": 2,
@ezze
ezze / zoomLevel.js
Created April 18, 2017 00:03
Cesium: calculate camera heights for tile zoom levels
var zoomLevelHeights = getZoomLevelHeights(1);
for (var i = 0; i < zoomLevelHeights.length; i++) {
console.log('Level: ' + zoomLevelHeights[i].level + ', camera height: ' + zoomLevelHeights[i].height);
}
function getZoomLevelHeights(precision) {
precision = precision || 10;
var step = 100000.0;