This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { exec } from 'node:child_process'; | |
import fs from 'node:fs/promises'; | |
import path from 'node:path'; | |
const HOME_DIR = process.env.HOME || process.env.USERPROFILE; | |
async function getVSIXPackage(vendor, extensionName) { | |
const payload = { | |
assetTypes: null, | |
filters: [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# syntax=docker/dockerfile:experimental | |
# 🟠 If the Docker image is built on an M1 chip then you’ll notice this container error | |
# docker rmi --force daniil4udo/pnpm-slim:latest | |
# DOCKER_BUILDKIT=1 docker buildx build --platform=linux/amd64 -t daniil4udo/pnpm-slim . --no-cache | |
# docker push daniil4udo/pnpm-slim:latest | |
FROM --platform=linux/amd64 node:14.19.0-buster-slim | |
RUN npm i -g pnpm@^6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let options = { | |
padding: 15, | |
yRange: [0, 10, 20, 30, 40, 50], | |
fontSize: 12, | |
fillColor: '#00e5ff', | |
strokeColor: '#263238', | |
xRange: ["Cluster 1", "Cluster 2", "Cluster 3", "Cluster 4", "Cluster 5"] | |
} | |
const startButton = document.getElementById('start'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// String to Unicode | |
export function strEncodeUTF16(x: string) { | |
const z = []; | |
const strLen = x.length; | |
const trimSpaces = false; // whitespaces | |
const s = '\\u'; | |
let charCode; | |
for (let v = 0; v < strLen; v++) { | |
charCode = x.charCodeAt(v); | |
if (trimSpaces == false && d(charCode) == true) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Example | |
https://habr.com/ru/post/500014/ | |
*/ | |
/* Mobile and Tablet */ | |
@media (max-width: 768px) { | |
html { | |
font-size: calc(16px + 2 * ((100vw - 360px) / 768)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* No workers way | |
*/ | |
function request(url) { | |
return new Promise(function (resolve, reject) { | |
const xhr = new XMLHttpRequest(); | |
xhr.overrideMimeType("application/json"); | |
xhr.open('GET', url, true); | |
xhr.onreadystatechange = _ => { | |
if (xhr.readyState === 4) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const ComponentContext = require.context('./widgets', true, /\.vue$/i, 'lazy'); | |
ComponentContext.keys().forEach((componentFilePath) => { | |
const componentName = componentFilePath.split('/').pop().split('.')[0]; | |
console.log(`Dmc${capitalize(componentName)}`); | |
Vue.component(`Dmc_${componentName}`, () => ComponentContext(componentFilePath)); | |
}); | |
/* | |
computed: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Replace word in the file / files | |
perl -pi -w -e 's/SEARCH_FOR/REPLACE_WITH/g;' *.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Implying you already have Heroku CLI | |
# Create Procfile & add script from package.json to run | |
touch Procfile | |
echo > "web: npm run prod" Procfile | |
# Create new app | |
heroku create | |
# Add config variable |
NewerOlder