Skip to content

Instantly share code, notes, and snippets.

@segg21
segg21 / Route.php
Last active August 24, 2018 08:01
Simple routing php
<?php
/*
\| Route/PHPRouting101
\| @author => LegitSoulja
\| @copyright => LegitSoulja
\| @license => Apache
\| @source => https://gist.github.com/LegitSoulja/ae1c56af0999be898dee1ec5ced6318c
\| @source => https://github.com/LegitSoulja/PHPRouting101
*/
/*
@segg21
segg21 / gist:8c726621e1f81cad9da508b14bff1769
Created July 7, 2018 22:31 — forked from jameshartig/gist:2357002
Get MP3 bit rate and sample rate in PHP
//returns an assoc array with bitRate (kbps) and sampleRate (hz)
function getMP3BitRateSampleRate($filename)
{
if (!file_exists($filename)) {
return false;
}
$bitRates = array(
array(0,0,0,0,0),
array(32,32,32,32,8),
@segg21
segg21 / buffer.js
Last active December 30, 2018 06:42
(function(){
class Reader {
constructor(buffer) {
this.index = 0;
this.buffer = new DataView(buffer);
}
readInt8() {
return this.buffer.getInt8(this.index++);
"use strict";
class Reader {
constructor(buffer) {
this.index = 0;
this.buffer = buffer;
}
readInt8() {
return this.buffer.readInt8(this.index++);
@segg21
segg21 / spec.md
Created May 19, 2019 01:34 — forked from ePirat/spec.md
Icecast Protocol specification

Icecast protocol specification

What is the Icecast protocol?

When speaking of the Icecast protocol here, actually it's just the HTTP protocol, and this document will explain further how source clients need to send data to Icecast.

HTTP PUT based protocol

Since Icecast version 2.4.0 there is support for the standard HTTP PUT method. The mountpoint to which to send the data is specified by the URL path.

@segg21
segg21 / Skins.json
Last active March 8, 2023 07:53
300+ Rust Skins Per Item for Skins Plugin (Non Accepted Skins)
{
"Command": "skin",
"Skins": [
{
"Item Shortname": "fun.guitar",
"Skins": [
1287805625,
814874910,
1186248895,
1196457681,
@segg21
segg21 / Skins_Objects.json
Last active May 15, 2024 15:48
300+ Array/Object list of Rust Skins Per Item. (Non Accepted Skins)
{
"fun.guitar": [
1287805625,
814874910,
1186248895,
1196457681,
937928933,
843572627,
877194688,
843693036,
@segg21
segg21 / Query.php
Last active January 27, 2021 01:14
Steam Source UDP PHP Query Script
<?php
namespace Query {
use Query\Buffer\BinaryReader;
class Socket {
private $socket;
private static $timeout = array('sec'=>4, 'usec' => 0);
@segg21
segg21 / mod_dds_header.lua
Created August 13, 2021 20:48 — forked from hhrhhr/mod_dds_header.lua
RP6L unpacker. Usage: rp6l.lua <filename.rpack> [output_directory]
assert(_VERSION == "Lua 5.3")
-- DDS header [32]
_fourcc = 1; _size = 2; _flags = 3; _height = 4
_width = 5; _pitch = 6; _depth = 7; _mipmaps = 8
-- reserved [44]
-- 9 10 11 12
-- 13 14 15 16
-- 17 18 19
-- DDSPixelFormat [32]
@segg21
segg21 / lock.js
Created August 26, 2021 03:36
Javascript Lock Method/Function
/*
Some thoughts about Javascript, there's no threads but what if this happens?
I may also be a bad way to use while, as I thought maybe the lock object should hold
any functions that must be called.. I may just update this in the future, but this is potentially
a way you could lock executions for something? Have fun!
Author. S.R (Segfault)
Date: Aug 25, 2021
*/