Skip to content

Instantly share code, notes, and snippets.

View sixthgear's full-sized avatar

Joshua Cender sixthgear

View GitHub Profile
"""
This module handles the classes reponsible for creating a TCP socket server.
It should be resuable for any telnet-like application, and should not contain
any game logic or formatting code.
TODO: register event handlers so that our engine can hook in to server events
TODO: needs asynchronicity
"""
import socket
"""
This module handles the classes reponsible for creating a TCP socket server.
It should be resuable for any telnet-like application, and should not contain
any game logic or formatting code.
TODO: register event handlers so that our engine can hook in to server events
TODO: needs asynchronicity
"""
import socket
class Language(models.Model):
name = models.CharField(max_length=100)
def __unicode__(self):
return self.name
class Solution(models.Model):
problem = models.ForeignKey(Problem)
author = models.ForeignKey(User)
title = models.CharField(max_length=100, blank=True)
submitted = models.DateField(auto_now_add=True)
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
"Write your forwards methods here."
@sixthgear
sixthgear / test.py
Created February 16, 2011 23:42
Test Github
print "Hello World!"
@sixthgear
sixthgear / test.py
Created February 19, 2011 22:49
test test test
print 'Hellllllo World!'
<script type="text/javascript">
function getData() {
$.getJSON("script.php", function(data) {
$.each(data, function(index) {
$("#high").html(data[index].high + "<br />" + Math.floor(Math.random()*111));
});
});
}
#include <stdio.h>
int main(int l, char **a) {
for(int i = 0; i < l/2; a[++i] = (((int)a[i]+(int)a[l-i])-(int)(a[l-i]=a[i])) );
for(int i = 1; i < l; ++i)
printf("%s ", a[i]);
return 0;
}
/* sixthgear's horrible inplace reverse */
#include <stdio.h>
int
main()
{
int i;
int l = 9;
int a[] = {1,2,3,4,5,6,7,8,9};
@sixthgear
sixthgear / file.js
Created August 10, 2011 03:16 — forked from anonymous/file.js
/*Using JQuery to pull files from italy.xml*/
$(document).ready(function() {
$.ajax({
type: "GET",
url: "xml/italy.xml",
dataType: "xml",
success: handleResponse
});
}); //end ready