Skip to content

Instantly share code, notes, and snippets.

Avatar

Zack Zatkin-Gold zg

View GitHub Profile
@zg
zg / cloak.c
Created Jul 26, 2011
Part of cloak.c from UnrealIRCd
View cloak.c
static char *hidehost_ipv4(char *host)
{
unsigned int a, b, c, d;
static char buf[512], res[512], res2[512], result[128];
unsigned long n;
unsigned int alpha, beta, gamma;
/*
* Output: ALPHA.BETA.GAMMA.IP
* ALPHA is unique for a.b.c.d
View class.Highscores.php
<?php
class Highscores {
public $skills = array (
'attack','defence','strength','hitpoints','range',
'prayer','magic','cooking','woodcutting','fletching',
'fishing','firemaking','crafting','smithing','mining',
'herblore','agility','thieving','slayer','farming',
'runecraft',
'overall'
);
@zg
zg / npc-xml.php
Created Jul 22, 2011
Something to do with NPCs and XML...
View npc-xml.php
<?php
if(count($_GET) > 0)
{
$xmlstr = "<npcspawn>
<npcId>{$_GET['npcId']}</npcId>
<locationz>
<x>{$_GET['x']}</x>
<y>{$_GET['y']}</y>
<z>{$_GET['z']}</z>
</locationz>
View class.db.php
<?php
/*********************************************************************
* Database Abstraction Layer
**********************************************************************
* Related Files:
* --------------------------------------------------------------
**********************************************************************
* Revision History:
* --------------------------------------------------------------
@zg
zg / database.php
Created Jul 22, 2011
Login/Register
View database.php
<?php
//require this to get a database connection
$connect = mysql_connect('localhost','test','test');
mysql_select_db('test');
?>
View gist:34658b9a34aa7a21710a
Verifying I am +zg on my passcard. https://onename.com/zg
View gist:06bbe6ed855aead73761
48 87 15 43 25
65 91 19 19 76
21 46 72 29 8
22 55 7 95 55
11 36 11 33 3
39 9 49 66 52
95 97 44 96 82
53 44 1 86 11
48 45 26 3 9
54 98 83 86 20
View endian.c
#include <stdio.h>
int main(){
unsigned int i = 1;
char *p = (char *)&i;
if(*p == 0)
printf("big endianness");
else
printf("little endianness");
View gist:9776652
37107287533902102798797998220837590246510135740250
46376937677490009712648124896970078050417018260538
74324986199524741059474233309513058123726617309629
91942213363574161572522430563301811072406154908250
23067588207539346171171980310421047513778063246676
89261670696623633820136378418383684178734361726757
28112879812849979408065481931592621691275889832738
44274228917432520321923589422876796487670272189318
47451445736001306439091167216856844588711603153276
70386486105843025439939619828917593665686757934951
You can’t perform that action at this time.