Skip to content

Instantly share code, notes, and snippets.

View psyomn's full-sized avatar
♥️
HARD WORK AND DISCIPLINE

psyomn

♥️
HARD WORK AND DISCIPLINE
View GitHub Profile
@psyomn
psyomn / .svnignore
Created January 25, 2012 00:51
Svn Ignore / Bladerunners
# For the C# project of bladerunners!
bin
obj
@psyomn
psyomn / registry.rb
Created April 30, 2012 21:39
Just a simple udp server that can be used as a registry.
require 'socket'
# This is the main registry.
# When an individual node is started, it first looks
# for the registry and provides its information so that
# other nodes can query this entity for the location of
# said nodes.
class Registry
@psyomn
psyomn / xmler.rb
Created October 9, 2012 14:32
Making objects to XML with Rubys' reflection (still wip)
# Author::Simon Symeonidis
# This is a funky way to produce xml from a very simple object
# with very simple instance variables. I was particularly amused
# with the 'send' function since many times in OOP, we say that
# the objects are sending messages to each other; however in this
# case it's quite literal.
#
# If for some reason you want to use this dumb script to check it
# out, it's very simple. Just create a class Person with instance
# variables 'name', and 'surname' and include the module in the
@psyomn
psyomn / gist:3956399
Created October 26, 2012 01:00
Creating a table in SQLite3 + C
#include <stdio.h>
#include <sqlite3.h>
static int
print_table_variables
(
void * NotUsed
, int rows_affected
, char ** field_value
, char ** column_name
@psyomn
psyomn / gist:3991057
Created November 1, 2012 01:32
Circlejerking with Rust
/**
test comments
*/
fn main()
{
io::println("HELLO WORLD");
let x: int = add_numbers(12,21);
io::println(fmt!("Add numbers function : %d" , x));
io::println(fmt!("Cound and add numbers : %?" , count_and_add_numbers(10)));
@psyomn
psyomn / main.proc.rb
Created January 25, 2013 20:47
Proc example
#
# Proc demonstration
#
my_code1 = Proc.new do
puts 1
sleep 0.5
puts 2
sleep 0.5
puts 3
@psyomn
psyomn / entity_widget.rb
Created March 3, 2013 02:38
Small demo of how nice Qt bindings for ruby is.
require 'Qt4'
require 'domain/commands/create_entity_command.rb'
require 'domain/entity_mapper.rb'
# Author :: Simon Symeonidis
# The entity widget for the game editor. This is loaded and accessed as a tab
# along with all the other uis.
#
# TODO: this should have a list at a side of current entities, and the ui used
# to either edit the selected entity, or save a new one.
@psyomn
psyomn / lists1.erl
Created March 11, 2013 13:38
Some Erlang scripts I wrote some time ago for practice.
-module(lists1).
-author(psyomn).
-export([mymin/1,mymax/1,min_max/1,swedish_date/0]).
mymin([H|T]) -> mymin(T,H).
mymin([],Acc) -> Acc;
mymin([H|T],Acc) when H < Acc -> mymin(T,H);
mymin([_|T],Acc) -> mymin(T,Acc).
@psyomn
psyomn / db_registry.rb
Created March 18, 2013 19:44
Make blob dbs to benchmarks against selects (see if there's degradation in lookups when there's a lot of blob data).
require 'sqlite3'
require 'singleton'
class DbRegistry
include Singleton
def initialize
@handle = SQLite3::Database.new("db.db")
end
@psyomn
psyomn / main.tex
Created April 24, 2013 16:17
Very simple latex file.
% This is a very stripped down example of what a latex document looks like.
\documentclass[twoside]{article}
\title{Sample document}
\author{Anne Ominous}
\date{\today}
\usepackage[margin=0.8in]{geometry}