Skip to content

Instantly share code, notes, and snippets.

View fitwist's full-sized avatar
🏠
Working from home

Helen Kapatsa fitwist

🏠
Working from home
View GitHub Profile
@fitwist
fitwist / gist:642c9c17267bb210fffd8367b9968dd3
Created July 19, 2024 10:16
How to get Google Cloud API access_token via refresh_token in JavaScript
const axios = require('axios');
async function getRefreshToken(clientId, clientSecret, refreshToken) {
const tokenUrl = 'https://oauth2.googleapis.com/token';
const params = new URLSearchParams();
params.append('client_id', clientId);
params.append('client_secret', clientSecret);
params.append('refresh_token', refreshToken);
params.append('grant_type', 'refresh_token');
from google.cloud import bigquery
from selenium import webdriver;
from selenium.webdriver.common.by import By
import asyncio
import os
import pandas as pd
import re
import telegram
TELEGRAM_API_KEY = "API Key"
@fitwist
fitwist / gist:5d0eb1509976d52063633f10063f61b5
Created May 10, 2023 13:45
Aiogram: хэндлер разметки
@dp.message_handler(commands=['start'], state=None)
async def start(message: types.Message, state: FSMContext):
'''Точка входа'''
tg_id = message.chat.id
name = message.from_user.first_name
full_name = message.from_user.full_name
reg = re.compile('[^\w 0-9 \.,]')
f_name = reg.sub('', full_name)
@fitwist
fitwist / EventInput
Last active August 13, 2021 11:12
DialogFlow API event query as a chat trigger on PHP
<?php
namespace Google\Cloud\Dialogflow\V2;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;
class EventInput extends \Google\Protobuf\Internal\Message
{
@fitwist
fitwist / 3dmodel.js
Created February 13, 2020 14:26
Working 'three' library syntax (5 Sep 2019)
import React, { Component } from "react";
import * as THREE from "three";
import * as FBXLoader from 'three-fbxloader-offical';
// eslint-disable-next-line
import * as Dat from "dat.gui"
import {TimelineMax, Expo, Power0} from 'gsap/all';
import img from '../../textures/ship01RebuildGeo_lambert2_Diffuse.jpg';
import bump from '../../textures/ship01RebuildGeo_lambert2_Glossiness.jpg';
import fbx from '../../source/Trader.fbx';
@fitwist
fitwist / spaceship.js
Created December 2, 2019 15:55
3d-model-textures
import React, { Component } from "react";
import * as THREE from "three";
import * as FBXLoader from 'three-fbxloader-offical';
// eslint-disable-next-line
import * as Dat from "dat.gui"
import {TimelineMax, Expo, Power0} from 'gsap/all';
import img from '../../textures/ship01RebuildGeo_lambert2_Diffuse.jpg';
import bump from '../../textures/ship01RebuildGeo_lambert2_Glossiness.jpg';
import fbx from '../../source/Trader.fbx';
@fitwist
fitwist / index.js
Last active May 25, 2019 14:17
index.js
module.exports = function() {
console.log("Hello Mars!")
}