Skip to content

Instantly share code, notes, and snippets.

View oddmario's full-sized avatar

Mario oddmario

View GitHub Profile
@MineTheCube
MineTheCube / mc-api.php
Last active June 11, 2024 14:32
PHP functions to convert UUID to/from Minecraft username
<?php
/**
* Get UUID from Username
*
* @param string $username
* @return string|bool UUID (without dashes) on success, false on failure
*/
function username_to_uuid($username) {
$profile = username_to_profile($username);
@uupaa
uupaa / image.resize.in.github.flavored.markdown.md
Last active August 11, 2025 13:09
image resize in github flavored markdown.

Image source

https://gyazo.com/eb5c5741b6a9a16c692170a41a49c858.png

Try resize it!

  • ![](https://gyazo.com/eb5c5741b6a9a16c692170a41a49c858.png | width=100)
@wyvernzora
wyvernzora / xhr-spy.js
Last active June 23, 2023 09:58
Browser XHR Spy
/**
* The following code, when executed in a browser's JS console,
* will log detailed information about every XHR made from the
* web page. Perfect for spying on API calls.
*/
(function() {
var XHR = XMLHttpRequest.prototype;
// Remember references to original methods
var open = XHR.open;
var send = XHR.send;
@mlainani
mlainani / ipmon.py
Last active September 2, 2024 21:02
Sample pyroute2-based program for monitoring network events
#! /usr/bin/python
import Queue
from pyroute2 import IPDB
import signal
import threading
work_queue = Queue.Queue()
ip = IPDB()
@mobleyc
mobleyc / http_get.go
Created October 5, 2015 01:06
Creating a custom HTTP Transport and Client with Go
package main
import (
"fmt"
"io/ioutil"
"net"
"net/http"
"os"
"time"
)
@frob
frob / months.php
Created October 13, 2015 22:50
Long and short month names in a php array.
<?php
$short = array(
'Jan',
'Feb',
'Mar',
'Apr',
'May',
'Jun',
'Jul',
@gokulkrishh
gokulkrishh / media-query.css
Last active August 13, 2025 11:53
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
/* CSS */
@fevangelou
fevangelou / my.cnf
Last active August 14, 2025 08:10
Optimized my.cnf configuration for MySQL/MariaDB (on Ubuntu, CentOS, Almalinux etc. servers)
# === Optimized my.cnf configuration for MySQL/MariaDB (on Ubuntu, CentOS, Almalinux etc. servers) ===
#
# by Fotis Evangelou, developer of Engintron (engintron.com)
#
# ~ Updated September 2024 ~
#
#
# The settings provided below are a starting point for a 8-16 GB RAM server with 4-8 CPU cores.
# If you have different resources available you should adjust accordingly to save CPU, RAM & disk I/O usage.
#
@joepie91
joepie91 / vpn.md
Last active August 13, 2025 17:41
Don't use VPN services.

Don't use VPN services.

No, seriously, don't. You're probably reading this because you've asked what VPN service to use, and this is the answer.

Note: The content in this post does not apply to using VPN for their intended purpose; that is, as a virtual private (internal) network. It only applies to using it as a glorified proxy, which is what every third-party "VPN provider" does.

  • A Russian translation of this article can be found here, contributed by Timur Demin.
  • A Turkish translation can be found here, contributed by agyild.
  • There's also this article about VPN services, which is honestly better written (and has more cat pictures!) than my article.
@andrewmilson
andrewmilson / file-upload-multipart.go
Last active June 28, 2025 18:41
Golang multipart/form-data File Upload
package main
import (
"net/http"
"os"
"bytes"
"path"
"path/filepath"
"mime/multipart"
"io"