Skip to content

Instantly share code, notes, and snippets.

View vladanyes's full-sized avatar
🏠
Working remotely

Vlad R vladanyes

🏠
Working remotely
  • Remote
View GitHub Profile
@konstantin24121
konstantin24121 / verifyTelegramWebAppData.tsx
Last active December 13, 2025 18:50
Telegram Bot 6.0 Validating data received via the Web App node implementation
const TELEGRAM_BOT_TOKEN = '110201543:AAHdqTcvCH1vGWJxfSeofSAs0K5PALDsaw'; // https://core.telegram.org/bots#creating-a-new-bot
export const verifyTelegramWebAppData = async (telegramInitData: string): boolean => {
// The data is a query string, which is composed of a series of field-value pairs.
const encoded = decodeURIComponent(telegramInitData);
// HMAC-SHA-256 signature of the bot's token with the constant string WebAppData used as a key.
const secret = crypto
@LintangWisesa
LintangWisesa / StackBarChart.js
Created October 11, 2019 09:29
React Native Chart Kit - #4 Stacked Bar Chart
<StackedBarChart
data={{
labels: ["Test1", "Test2"],
legend: ["L1", "L2", "L3"],
data: [[60, 60, 60], [30, 30, 60]],
barColors: ["#dfe4ea", "#ced6e0", "#a4b0be"]
}}
width={Dimensions.get("window").width - 50} // from react-native
height={220}
yAxisLabel={"Rp"}
@javilobo8
javilobo8 / download-file.js
Last active May 13, 2025 05:55
Download files with AJAX (axios)
axios({
url: 'http://localhost:5000/static/example.pdf',
method: 'GET',
responseType: 'blob', // important
}).then((response) => {
const url = window.URL.createObjectURL(new Blob([response.data]));
const link = document.createElement('a');
link.href = url;
link.setAttribute('download', 'file.pdf');
document.body.appendChild(link);
@glebcha
glebcha / gulpfile.js
Last active September 3, 2025 14:54
Gulp task sample (css and js minify+concat, compress images, watching for changes)
// Определяем зависимости в переменных
var gulp = require('gulp'),
cache = require('gulp-cache'),
clean = require('gulp-clean'),
stream = require('event-stream'),
size = require('gulp-size'),
jshint = require('gulp-jshint'),
concat = require('gulp-concat'),
uglify = require('gulp-uglify'),
minifyCSS = require('gulp-minify-css'),