Skip to content

Instantly share code, notes, and snippets.

View shanezhiu's full-sized avatar
🎯
Focusing

shane shanezhiu

🎯
Focusing
View GitHub Profile
@mlocati
mlocati / exceptions-tree.php
Created March 9, 2017 10:58
Throwable and Exceptions tree
<?php
if (!function_exists('interface_exists')) {
die('PHP version too old');
}
$throwables = listThrowableClasses();
$throwablesPerParent = splitInParents($throwables);
printTree($throwablesPerParent);
if (count($throwablesPerParent) !== 0) {
die('ERROR!!!');
@berkayunal
berkayunal / redis.service
Created February 10, 2017 01:19 — forked from ordoghl/redis.service
redis systemd unit file
Description=Redis In-Memory Data Store
After=network.target
[Service]
Type=forking
User=redis
Group=redis
Environment=statedir=/run/redis
PermissionsStartOnly=true
PIDFile=/run/redis/redis.pid
@cstroe
cstroe / OpenSourceCRM.rst
Last active May 12, 2025 18:35
A distilled list of open-source CRM software
  • What do Etcd, Consul, and Zookeeper do?
    • Service Registration:
      • Host, port number, and sometimes authentication credentials, protocols, versions numbers, and/or environment details.
    • Service Discovery:
      • Ability for client application to query the central registry to learn of service location.
    • Consistent and durable general-purpose K/V store across distributed system.
      • Some solutions support this better than others.
      • Based on Paxos or some derivative (i.e. Raft) algorithm to quickly converge to a consistent state.
  • Centralized locking can be based on this K/V store.
@Decicus
Decicus / GetServerList.md
Last active May 14, 2024 16:49
Steam - GetServerList (DayZ)

GetServerList

  • API endpoint: https://api.steampowered.com/IGameServersService/GetServerList/v1/?filter=\gamedir\dayz\name_match\*Experimental*&limit=5000&key=
  • The filter parameter can be any of these: https://developer.valvesoftware.com/wiki/Master_Server_Query_Protocol#Filter
  • The limit parameter is maximum amount of servers to return. I haven't tested anything higher than 10000 (ten thousand).
    • It seems this accepts pretty much any number, but the highest amount of servers I've gotten listed is 20,000 (twenty thousand).
  • The key parameter is your Steam API key, which I'm sure you already have, but if not: https://steamcommunity.com/dev
@laobubu
laobubu / ABOUT.md
Last active March 12, 2025 21:04
A very simple HTTP server in C, for Unix, using fork()

Pico HTTP Server in C

This is a very simple HTTP server for Unix, using fork(). It's very easy to use

How to use

  1. include header httpd.h
  2. write your route method, handling requests.
  3. call serve_forever("12913") to start serving on port 12913
@abravalheri
abravalheri / commit.md
Last active March 26, 2025 10:52 — forked from stephenparish/commit.md
RFC: Git Commit Message Guidelines

Commit Message Guidelines

In the last few years, the number of programmers concerned about writing structured commit messages have dramatically grown. As exposed by Tim Pope in article readable commit messages are easy to follow when looking through the project history. Moreover the AngularJS contributing guides introduced conventions that can be used by automation tools to automatically generate useful documentation, or by developers during debugging process.

This document borrows some concepts, conventions and even text mainly from these two sources, extending them in order to provide a sensible guideline for writing commit messages.

@matula
matula / awesm.md
Last active February 19, 2024 16:23
Awesome PHP stuff in one Gist
@PurpleBooth
PurpleBooth / README-Template.md
Last active May 15, 2025 16:42
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@CMCDragonkai
CMCDragonkai / http_streaming.md
Last active May 9, 2025 01:58
HTTP Streaming (or Chunked vs Store & Forward)

HTTP Streaming (or Chunked vs Store & Forward)

The standard way of understanding the HTTP protocol is via the request reply pattern. Each HTTP transaction consists of a finitely bounded HTTP request and a finitely bounded HTTP response.

However it's also possible for both parts of an HTTP 1.1 transaction to stream their possibly infinitely bounded data. The advantages is that the sender can send data that is beyond the sender's memory limit, and the receiver can act on