Skip to content

Instantly share code, notes, and snippets.

View sixthgear's full-sized avatar

Joshua Cender sixthgear

View GitHub Profile
#!/usr/bin/env python
"""
Usage: ./fxuy.py [f] [u]
Example: ./fxuy.py 7 12
Requires: banner or printerbanner
"""
import os
import sys
import subprocess
@sixthgear
sixthgear / hash.c
Created December 21, 2011 04:05
Generic Hash Table
#include "hash.h"
table *
ht_init(int num, size_t type_size, int key_len, void *hf, void *pf)
{
size_t total_size;
total_size = sizeof(table); /* table */
total_size += sizeof(char) * num * key_len; /* keys */
total_size += (type_size * num); /* values */
table *ht = malloc(total_size);
@sixthgear
sixthgear / vect.h
Created December 21, 2011 22:14
Generic Vector Type in C
#ifndef VECT_H
#define VECT_H
/*
* vect.h -- type-safe generic dynamic array
* made by sixthgear. BSD Licenced.
*/
#include <stdio.h>
#include <stdlib.h>
@sixthgear
sixthgear / 1984_words.txt
Created December 23, 2011 18:54
1984 words
# 0.06s user 0.00s system 75% cpu 0.081 total
astronomical: 1
but: 627
commanded: 1
blazed: 1
buy: 9
finally: 19
whenever: 14
regulation: 2
size_t
func(short a[])
{
return sizeof(a);
}
int
main()
{
short arr[10];
//The sum of the squares of the first ten natural numbers is,
//12 + 22 + ... + 102 = 385
//The square of the sum of the first ten natural numbers is,
//(1 + 2 + ... + 10)2 = 552 = 3025
/*Hence the difference between the sum of the squares of the first ten
natural numbers and the square of the sum is 3025 − 385 = 2640.*/
/*Find the difference between the sum of the squares of the first one
--------------------------------------------------------------
DoomRL (v.0.9.9.6G) roguelike post-mortem character dump
--------------------------------------------------------------
sixthgear, level 5 Human Private Marine,
was splayed by a hell knight on level 7 of the Phobos base.
He survived 46728 turns and scored 16092 points.
He played for 51 minutes and 15 seconds.
He didn't like it too rough.
"""
Simple python dice module.
By sixthgear <sixthgear@sixthgear.ca>
"""
import random
import fractions
import itertools
class Dice(object):
22:28 < greghaynes> Are the happy hacking keyboards worth it?
22:28 < milkshakes> or i will have to unfriend you
22:29 < desg> lmao
00:37 < seabot> meenuh: if a girl hugs me is it okay to ask her if she wants to have sex
00:37 < AeroNotix> seabot: Perfectly acceptable
00:37 < desg> lmao
17:57 < Distilled> LOL
17:58 < Distilled> Patch notes: Prevent motherboard from catching fire.
@sixthgear
sixthgear / gist:3128282
Created July 17, 2012 09:19
PQ7 part 2
; roman.s
; x86/BSD
section .text
global start
start:
pop ecx ; argc
cmp ecx, 2 ; make sure we have input
jl argerror