Skip to content

Instantly share code, notes, and snippets.

View designervoid's full-sized avatar
🌄

designervoid

🌄
View GitHub Profile
@cvan
cvan / debug-tailwind.md
Created February 16, 2023 04:55
debug tailwind

show me all the Tailwind CSS classes to use in my project

which CSS selectors to use? this shows all the (non-dynamic) options generated from your project's tailwind.config.js.

rogden/tailwind-config-viewer is the best. run from the command line:

npx tailwind-config-viewer -o 
@TrueCarry
TrueCarry / Better proof
Last active May 22, 2024 22:16
TON Connect V2 Proof verification
https://github.com/ton-connect/demo-dapp-with-react-ui/blob/master/src/server/services/ton-proof-service.ts
@zubiden
zubiden / validate_init_data.js
Created April 17, 2022 03:33
Telegram Web Bots data validation in JavaScript via Web Crypto API (dependency-free)
// Thanks to @MarvinMiles for Telegram Widget Login check function https://gist.github.com/MarvinMiles/f041205d872b0d8547d054eafeafe2a5
// This function validates Web App input https://core.telegram.org/bots/webapps#validating-data-received-via-the-web-app
// Transforms Telegram.WebApp.initData string into object
function transformInitData(initData) {
return Object.fromEntries(new URLSearchParams(initData));
}
// Accepts init data object and bot token
async function validate(data, botToken) {
@tvorogme
tvorogme / generate.fif
Last active May 29, 2024 09:15
TON deploy smart contract
#!/usr/bin/fift -s
"TonUtil.fif" include
"Asm.fif" include
// If you dont know about stack-base languages
// Please read something before read comments and trying to understand what is going on here :)
5 :$1..n // parse arguments
$1 parse-workchain-id =: wc // set workchain id from command line argument
$2 parse-int =: subwallet-id // set subwallet id
@zmts
zmts / pg_jsonb_push.md
Last active October 25, 2021 17:16
Insert(push) object to nested array. JSONB PostgreSQL

Insert(push) object to nested array. JSONB PostgreSQL

// posts table

| id | content          |
|----|------------------|
| 40 | jsonb data       |
@zmts
zmts / imageSize.md
Created June 6, 2020 16:48
Get image width and height with JavaScript

Get image width and height with JavaScript

function imageSize (image) {
  return new Promise((resolve, reject) => {
    try {
      const fileReader = new FileReader()

      fileReader.onload = () => {
 const img = new Image()
@alexbaumgertner
alexbaumgertner / app-builder.Dockerfile
Last active February 23, 2024 11:23
Docker and private github packages
ARG DEPS_IMAGE=deps-installer:latest
FROM $DEPS_IMAGE as deps-installer
FROM node:8.15.0-alpine
WORKDIR /app
COPY ./ ./
COPY --from=deps-installer /deps/node_modules ./node_modules
@kanzitelli
kanzitelli / docker-compose.yml
Created September 12, 2019 18:31
Docker Compose file with Traefik, Backend and MongoDB configured. For running locally.
version: '3'
services:
reverse-proxy:
image: traefik:v2.0
container_name: traefik
command: --api --providers.docker
ports:
- "6969:80"
- "6970:8080"

Everything I Know About UI Routing

Definitions

  1. Location - The location of the application. Usually just a URL, but the location can contain multiple pieces of information that can be used by an app
    1. pathname - The "file/directory" portion of the URL, like invoices/123
    2. search - The stuff after ? in a URL like /assignments?showGrades=1.
    3. query - A parsed version of search, usually an object but not a standard browser feature.
    4. hash - The # portion of the URL. This is not available to servers in request.url so its client only. By default it means which part of the page the user should be scrolled to, but developers use it for various things.
    5. state - Object associated with a location. Think of it like a hidden URL query. It's state you want to keep with a specific location, but you don't want it to be visible in the URL.
@solkaz
solkaz / detox-ts.md
Last active August 24, 2023 11:06
Writing Detox Tests with TypeScript

Usage

This guide assumes you've got a project using Detox with Jest, and you want to write your Detox tests in TypeScript.

  • Refer to this guide if you need to set up such a project.

1. Add TypeScript + ts-jest to package.json

We'll be using ts-jest to run Jest tests with TypeScript.