Skip to content

Instantly share code, notes, and snippets.

Avatar

Zack Zatkin-Gold zg

View GitHub Profile
@zg
zg / debian-xhyve.sh
Created May 13, 2016 — forked from lloeki/debian-xhyve.sh
Running debian 8.1 in xhyve
View debian-xhyve.sh
#!/bin/bash
# unfortunately debian currently panics in xhyve
tmp=$(mktemp -d)
pushd "$tmp"
iso="$HOME"/Downloads/debian-8.1.0-amd64-netinst.iso
#iso="$HOME"/Downloads/debian-8.1.0-i386-netinst.iso
echo "fixing disk"
dd if=/dev/zero bs=2k count=1 of=tmp.iso
@zg
zg / arch-xhyve.sh
Created May 13, 2016 — forked from lloeki/arch-xhyve.sh
Run Arch Linux in xhyve
View arch-xhyve.sh
#!/bin/bash
tmp=$(mktemp -d)
pushd "$tmp"
iso=/Users/lloeki/Downloads/archlinux-2015.08.01-dual.iso
echo "fixing disk"
dd if=/dev/zero bs=2k count=1 of=tmp.iso
dd if=$iso bs=2k skip=1 >> tmp.iso
echo "mounting disk"
View tmux.md

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

# remap prefix to Control + a
@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');
?>
@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.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'
);
View class.db.php
<?php
/*********************************************************************
* Database Abstraction Layer
**********************************************************************
* Related Files:
* --------------------------------------------------------------
**********************************************************************
* Revision History:
* --------------------------------------------------------------
You can’t perform that action at this time.