Skip to content

Instantly share code, notes, and snippets.

View kallefrombosnia's full-sized avatar
🎯
Focusing

Izet Mulalic kallefrombosnia

🎯
Focusing
View GitHub Profile
const https = require('https');
/**
* Define our function
*/
const ytSearchResult = (song) =>{
// return promised result
return new Promise((resolve, reject) =>{
@kallefrombosnia
kallefrombosnia / A2S_INFO.js
Created December 14, 2020 00:13
A2S_INFO with challenge resolver (new update from valve).
const udp = require('dgram');
// Create udp socket
const client = udp.createSocket('udp4');
const ip = '';
const port = 0;
// TSource Engine Query - normal query
const hex = Buffer.from('ffffffff54536f7572636520456e67696e6520517565727900', 'hex')
@kallefrombosnia
kallefrombosnia / lowdb-typescript.ts
Last active September 15, 2020 17:04
Example of setting lowdb with default values
import lowdb from 'lowdb';
import FileSync from 'lowdb/adapters/FileSync';
interface Teams {
team_name: string;
team_short_name: string;
team_logo_name: string;
team_description: string;
}
@kallefrombosnia
kallefrombosnia / functions.js
Last active September 15, 2020 17:03
JS function hoisting
// Demo example on https://repl.it/repls/SpottedUnwieldyMenu
// This will work
normalFunction();
function normalFunction(){
console.log('common dummy text');
}
// This will not work
@kallefrombosnia
kallefrombosnia / checkArrays.php
Created March 13, 2020 19:34
Check if 2 arrays are equal
<?php
$firstArray = [
'ID' => '57ef1717-b222-57b651',
'session' => [
'sessionID' => '8c776739-276059',
'timestamp' => '2020-03-13Z',
'place' => '/'
]
];
HLTV Documentation Version 3.1.1.1/4.1.1.1
Content
-------------------------------------------------------------------------------
1. Overview
2. Spectating Games
<?php
/*
This script subscribes to oncliententerview event, and fires callback on function.
In my function I took event invoker and his database id.
Later I used that dbid to find specific information about user.
Purpose is to assign new group if ip of invoker matches our allowed arrays.
*/
require_once('TeamSpeak3/TeamSpeak3.php');
@kallefrombosnia
kallefrombosnia / addGroup.php
Created November 27, 2018 00:29
Adds specific group to the all of clients online.
<?php
include_once('TeamSpeak3/TeamSpeak3.php');
// Connection configuration
$login_name = 'serveradmin'; // query login info
$login_password = ''; // =||=
$ip = 'localhost'; // ex. 127.0.0.1/ 254.13.121.12
$query_port = '10011'; // default 10011
$virtualserver_port= '9987'; // virtual server port
$group = '7'; // Specific group
@kallefrombosnia
kallefrombosnia / serverInfo.php
Created November 25, 2018 01:04
TS3 Server Info get with PHP framework
<?php
// First include our framework that we are gonna use
// You can download it from here https://github.com/planetteamspeak/ts3phpframework
include_once('TeamSpeak3/TeamSpeak3.php');
// Connection configuration
$login_name = 'serveradmin'; // query login info
$login_password = '9kg6eRKk'; // =||=
$ip = 'localhost'; // ex. 127.0.0.1/ 254.13.121.12
$query_port = '10011'; // default 10011