Skip to content

Instantly share code, notes, and snippets.

@Bo0m
Bo0m / shared_cookies.php
Created April 7, 2015 20:55
Storing cookies from a PHP CURL session outside of the cookie jar.
<?php
/**
* A quick example of storing CURL cookies outside of a local cookie jar file.
* Can be very useful for retaining API sessions between distributed applications.
**/
// Split out cookies from CURL response
function splitCookies($rawResponse, &$cookieData)
{
// Separate header and body
@Bo0m
Bo0m / sourcemod_whitelist_ip.sp
Created April 8, 2015 00:47
Locking down a SourceMod plugin to a specific server IP.
#define WHITELIST_IP "1.2.3.4"
new String:g_sServerIp[16];
public OnPluginStart()
{
// Pull server IP as integer from hostip, then bit shift into string format.
new iServerIP = GetConVarInt(FindConVar("hostip"));
Format(g_sServerIp, sizeof(g_sServerIp), "%i.%i.%i.%i", (iServerIP >> 24) & 0x000000FF, (iServerIP >> 16) & 0x000000FF, (iServerIP >> 8) & 0x000000FF, iServerIP & 0x000000FF);
@Bo0m
Bo0m / keybase.md
Created April 15, 2015 00:35
My Keybase proof.

Keybase proof

I hereby claim:

  • I am Bo0m on github.
  • I am bo0m (https://keybase.io/bo0m) on keybase.
  • I have a public key whose fingerprint is 545D 1C6E 3D5E 686F 7053 DE7D C739 5B2A F775 5E14

To claim this, I am signing this object: