Skip to content

Instantly share code, notes, and snippets.

View iuridiniz's full-sized avatar

Iuri Diniz iuridiniz

View GitHub Profile
@iuridiniz
iuridiniz / webserver.py
Created September 24, 2011 01:59
Using the twisted.protocols.portforward on SWTP
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2011 Iuri Gomes Diniz. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification, are
# permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this list of
# conditions and the following disclaimer.
@iuridiniz
iuridiniz / sica.pl
Created September 24, 2011 23:46
(UFRN) SIC Assembler
#!/usr/bin/perl
# SIC Assembler
#
# Iuri Gomes Diniz 20022688-2
# Paulo Guto Oliveira 20022700-5
# Filipe Gustavo Dias 20022679-3
#
# MAILTO: [email protected]
#
# Gera sic.out no diretorio atual (caso tenha conseguido montar).
@iuridiniz
iuridiniz / README
Created September 24, 2011 23:50
(UFRN) Exercícios de Haskell da disciplina LPCP (UFRN 2005 - LPCP)
Exercícios de Haskell da disciplina LPCP (UFRN 2005 - LPCP)
@iuridiniz
iuridiniz / 10209.c
Created September 24, 2011 23:56
(UFRN) Problemas ACM
#include <math.h>
#define PI 3.14159265358979323846 /* pi */
#include <stdio.h>
/**
* problema: http://acm.uva.es/p/v102/10209
*/
int main() {
double raio;
@iuridiniz
iuridiniz / rede.tcl
Created September 25, 2011 00:29
(UFRN) Reades AV
# Criar nossa rede
set ns [ new Simulator ]
# cores para o NAM?
# arquivo de saida
set nf [ open trace.out w]
$ns trace-all $nf
@iuridiniz
iuridiniz / BoxInvocado.cs
Last active December 25, 2018 02:57
(UFRN) Programas .Net
using System.Windows.Forms;
public class Box {
static void Main(string[] args) {
string mensagem;
string titulo;
DialogResult resultado;
@iuridiniz
iuridiniz / websocket_use.diff
Created October 4, 2011 01:15
WebSocket and MozWebSocket
@@ -12,7 +12,8 @@
element.appendChild(p);
}
- ws = new WebSocket("ws://localhost:8080/");
+ var Socket = "MozWebSocket" in window ? MozWebSocket : WebSocket;
+ var ws = new Socket("ws://localhost:8080/");
ws.onmessage = function(evt) { debug("Message: " + evt.data); };
ws.onclose = function() { debug("socket closed"); };
ws.onopen = function() {
@iuridiniz
iuridiniz / test_sqlalchemy_0_7_5_memleak.py
Created March 10, 2012 13:01
test_sqlalchemy_0_7_5_memleak.py
#!/usr/bin/python
# test sqlalchemy memory leak introduced in 0.7.5
# please refer to http://www.sqlalchemy.org/trac/ticket/2427
# Author: Iuri Diniz
import gc
from sqlalchemy import create_engine, Table, __version__
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, Integer, Unicode, String
from sqlalchemy.orm import sessionmaker
@iuridiniz
iuridiniz / synergyc.sh
Created May 24, 2012 13:29
ssh rc script ($HOME/.ssh/rc) in order to start synergyc
#!/bin/sh
# Author: Iuri Gomes Diniz <[email protected]>
getSSHclient() {
set -- $SSH_CLIENT
export CLIENT_IP="$1"
}
. /usr/share/acpi-support/power-funcs