Skip to content

Instantly share code, notes, and snippets.

View vasia123's full-sized avatar

Vasily Krakovetsky vasia123

View GitHub Profile
@noxx3xxon
noxx3xxon / arbitrage.py
Created August 21, 2022 22:34
CFMM Routing Arbitrage Example
import numpy as np
import cvxpy as cp
import itertools
# Problem data
global_indices = list(range(4))
# 0 = TOKEN-0
# 1 = TOKEN-1
# 2 = TOKEN-2

Install Android SDK CLI Ubuntu 20.04 WSL2 (Work in Progress)

Install Java 8

sudo apt install openjdk-8-jdk-headless

Android SDK

@pete-rai
pete-rai / find-image-in-image.js
Created January 13, 2021 17:29
Find an image within another image using nodejs, using the node sharp library (https://www.npmjs.com/package/sharp). Note: This does not handle PNG transparencies - I may add that next - let me know if you need it.
const sharp = require('sharp');
async function findImageWithinImage(outer, inner, max = 1) // max is the maximum occurences to find
{
let file_o = sharp(outer);
let file_i = sharp(inner);
let buff_o = await file_o.raw().toBuffer();
let buff_i = await file_i.raw().toBuffer();
let meta_o = await file_o.metadata();
let meta_i = await file_i.metadata();
@Zhendryk
Zhendryk / The Ultimate Windows Development Environment.md
Last active March 7, 2024 21:30
How to set up the ultimate Windows development environment
@xsduan
xsduan / async_sqlite.py
Last active April 3, 2024 17:27
peewee-async sqlite connection doohicky
"""
Temporary module to allow for sqlite databases during development. Remove once
we get an actual database.
"""
import peewee
from peewee_async import AsyncDatabase
import playhouse.sqlite_ext as sqlite_ext
try:
import aiosqlite
@mosquito
mosquito / proxy.py
Last active May 5, 2022 05:25
AIOHTTP async proxy streaming
import platform
import unittest
from http import HTTPStatus
from urllib.parse import urlencode, unquote
import aiohttp
import asynctest
from aiohttp import web
from aiohttp.test_utils import TestClient
from multidict import MultiDict
@jlccaires
jlccaires / UploadModal.vue
Last active January 5, 2021 12:55
Vue upload, gallery, preview, progress using vue-upload-component, Buefy, ElementUI and filesize.js
<template>
<b-modal :active="true" :onCancel="close">
<div class="modal-card">
<section class="modal-card-body">
<nav class="level">
<div class="level-left">
<el-tooltip v-if="errorFiles.length" placement="bottom" effect="light">
<div slot="content">
<div>
Alguns arquivos não puderam ser enviados:
@mfd
mfd / 06.png
Last active April 30, 2024 03:17
Gilroy font
06.png
anonymous
anonymous / japanese.md
Created March 18, 2017 10:44
japanese.md
@grachov
grachov / QuickOrder.php
Created June 4, 2014 13:10
Покупка товара в один клик для miniShop2
<?php
$context = $modx->context->get('key');
if ($context == 'mgr' || empty($_POST['quick_order']) || empty($_POST['id']) || empty($_POST['customer'])) {
return;
}
/**
* @var miniShop2 $miniShop2
*/
$miniShop2 = $modx->getService('minishop2');
$miniShop2->initialize($context, array(