Skip to content

Instantly share code, notes, and snippets.

View AsviS's full-sized avatar
💻

Ihor AsviS

💻
View GitHub Profile
@AsviS
AsviS / hamster.js
Created July 23, 2024 16:02 — forked from and7ey/hamster.js
Tampermonkey Chrome script to display best upgrades in Hamster Kombat
// ==UserScript==
// @name HamsterKombat Upgrades
// @namespace http://tampermonkey.net/
// @version 0.4
// @description Optimize upgrades based on profit/hour delta to price ratio
// @author You
// @match https://hamsterkombat.io/clicker/mine*
// @grant GM_xmlhttpRequest
// ==/UserScript==
@AsviS
AsviS / Laravel on VestaCP.md
Created July 2, 2023 14:49 — forked from peterbrinck/Laravel on VestaCP.md
Laravel web templates for VestaCP

I'm not using this or VestaCP anymore, so I can't confirm if still working or not.

I've made a new web template to make Laravel work easily on VestaCP, and so I wouldn't have to change my Laravel installation, if I ever wanted to deploy it elsewhere.

Each file should be put in /usr/local/vesta/data/templates/web/apache2

Then, when you edit your domain/site, you can change the web template to Laravel and just upload your whole project into public_html

@AsviS
AsviS / google.conf
Created September 23, 2021 21:20 — forked from 4ft35t/google.conf
google proxy config for nginx
server
{
deny all;
}
server
{
listen 80;
server_name gg.0xffff.tk;
@AsviS
AsviS / nginx_nodejs.md
Created April 14, 2020 14:59 — forked from tomasevich/nginx_nodejs.md
Сервер в связке Nginx + NodeJs

Сервер в связке Nginx + NodeJs

Данная пошаговая инструкция поможет освоить основы на простом примере

Для справки

Сервер поднимался на Debian 8 c характеристиками:

CPU - 1 ядро x 500 МГц

@AsviS
AsviS / PHP Appstore Validator
Created April 8, 2020 12:42 — forked from eduardo22i/PHP Appstore Validator
A file to validate an AppStore payment receipt using PHP.
<?php
//
// Appstore Production Purchase Validation
//
// Created by Eduardo Irías on 6/3/16.
//
$filebinary = basename($_FILES['receipt-data']['name']);

Keybase proof

I hereby claim:

  • I am asvis on github.
  • I am johnfreeman (https://keybase.io/johnfreeman) on keybase.
  • I have a public key ASAEJcY0kThtE0dFxMeA1kuCaIEyvJBe9Bus0bUcWgD8WAo

To claim this, I am signing this object:

@AsviS
AsviS / youtube.txt
Created August 1, 2018 20:45 — forked from iredun/youtube.txt
Youtube API get thumbnail image
Each YouTube video has 4 generated images. They are predictably formatted as follows:
http://img.youtube.com/vi/<insert-youtube-video-id-here>/0.jpg
http://img.youtube.com/vi/<insert-youtube-video-id-here>/1.jpg
http://img.youtube.com/vi/<insert-youtube-video-id-here>/2.jpg
http://img.youtube.com/vi/<insert-youtube-video-id-here>/3.jpg
The first one in the list is a full size image and others are thumbnail images. The default thumbnail image (ie. one of 1.jpg, 2.jpg, 3.jpg) is:
http://img.youtube.com/vi/<insert-youtube-video-id-here>/default.jpg
For the high quality version of the thumbnail use a url similar to this:
/*Use Fiddler Proxy*/
curl_setopt($ch, CURLOPT_PROXY, '127.0.0.1:8888');
/*Use Proxy*/
curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1);
curl_setopt($ch, CURLOPT_PROXY, "IP:PORT");
curl_setopt($ch, CURLOPT_PROXYUSERPWD, "username:password");
// PDO Connection to MySQL
$conn = new PDO('mysql:host=localhost;dbname=yourdbname', 'username', 'password');
// PDO Connection to PostgreSQL
$conn = new PDO('pgsql:host=localhost;dbname=yourdbname', 'username', 'password');
// A quick Select Query with For Loop
foreach ($conn->query("SELECT * FROM profile") as $row)
echo $row['fullname'];
@AsviS
AsviS / API.php
Created March 23, 2018 15:17
PHP Snippets
<?php
/**
* Parse JSON Data
*
*/
$json_string='{"id":1,"name":"foo","email":"[email protected]","interest":["wordpress","php"]} ';
$obj=json_decode($json_string);
echo $obj->name; //prints foo
echo $obj->interest[1]; //prints php