Skip to content

Instantly share code, notes, and snippets.

View issam-seghir's full-sized avatar
🏆
Always Learning - Always Improving ✨

Issam Seghir issam-seghir

🏆
Always Learning - Always Improving ✨
View GitHub Profile
@issam-seghir
issam-seghir / verifyTelegramWebAppData.tsx
Created December 6, 2024 17:50 — forked from konstantin24121/verifyTelegramWebAppData.tsx
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
@issam-seghir
issam-seghir / FlatListGapExample.jsx
Created December 3, 2024 10:57 — forked from intergalacticspacehighway/FlatListGapExample.jsx
Add gap in FlatList items with numColumns
import {Dimensions, FlatList, View} from 'react-native';
const screenWidth = Dimensions.get('window').width;
const numColumns = 2;
const gap = 5;
const availableSpace = screenWidth - (numColumns - 1) * gap;
const itemSize = availableSpace / numColumns;
const renderItem = ({item}) => {
@issam-seghir
issam-seghir / vscode-settings.md
Created July 6, 2024 10:53 — forked from mohokh67/vscode-settings.md
Install italic and customizable font for vscode

Link to Youtube video: https://youtu.be/QxcRmsGHcWY

Manual steps:

  • Download and install Victor Mono font
  • Update VSCode setting as bellow:
    • font size, line height and font weight are optional and you can update them as you prefer
{
  "editor.fontSize": 13,
  "editor.lineHeight": 24,

Image source

https://gyazo.com/eb5c5741b6a9a16c692170a41a49c858.png

Try resize it!

  • ![](https://gyazo.com/eb5c5741b6a9a16c692170a41a49c858.png | width=100)