Skip to content

Instantly share code, notes, and snippets.

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

psyomn

♥️
HARD WORK AND DISCIPLINE
  • Montreal
View GitHub Profile
@psyomn
psyomn / paranoia.user.js
Created May 24, 2013 14:32
Adds random eerie strings when browsing with Chrome. It was crudely made to scare a friend of mine.
// ==UserScript==
// @name Induced Paranoia
// @description They're out to get you.
// @version 1.0
// ==/UserScript==
(function ()
{
var phrases = [
@psyomn
psyomn / fpointers.c
Created May 24, 2013 13:17
How to give children nightmares at night.
/*
* How to give children nightmares at night.
*/
#include <stdio.h>
int func_a(int a, int b){ return a + b; }
int func_b(int a, int b){ return a - b; }
int func_c(int a, int b){ return a * b; }
int func_d(int a, int b){ return a / b; }
@psyomn
psyomn / retarded.rb
Created May 1, 2013 15:48
The most useful ruby script in the world.
p \
p p \
p p p \
p p p p \
p p p p p \
p p p p p p \
p p p p p p p \
p p p p p p p p \
p p p p p p p p p \
@psyomn
psyomn / konky.adb
Created April 27, 2013 23:48
Some Ada scraps from here and there.
-- @author Simon Symeonidis
-- A messy way to stop tasks. Define a global variable and have the loop bodies
-- for the tasks check that boolean variable if it is true or not, and continue
-- the looping or not, respectively.
with Ada.Text_IO;
procedure konky is
STOP_ANNOYING_PERSON : Boolean := False;
@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}
@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 / 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 / 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 / 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 / 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)));