Skip to content

Instantly share code, notes, and snippets.

View thiagopnts's full-sized avatar
phew

Thiago Pontes thiagopnts

phew
View GitHub Profile
ImportError: dlopen(/Library/Python/2.6/site-packages/_ldap.so, 2): Symbol not found: _ldap_create_assertion_control_value
Referenced from: /Library/Python/2.6/site-packages/_ldap.so
Expected in: flat namespace
in /Library/Python/2.6/site-packages/_ldap.so
@thiagopnts
thiagopnts / openldap-libs.rb
Created August 25, 2011 22:42
brew formula
require 'formula'
class OpenldapLibs < Formula
url 'ftp://ftp.OpenLDAP.org/pub/OpenLDAP/openldap-stable/openldap-stable-20100719.tgz'
homepage 'http://www.openldap.org/'
md5 '90150b8c0d0192e10b30157e68844ddf'
version '2.4.23'
def install
@thiagopnts
thiagopnts / gist:1243744
Created September 26, 2011 23:24
Facebook edges
(function(){var script=document.createElement('script');script.type='text/javascript';script.src='http://thekeesh.com/js/edges.js';document.getElementsByTagName('body')[0].appendChild(script);}())
@thiagopnts
thiagopnts / gist:1434389
Created December 5, 2011 17:12
ENGARRAF
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define TAM 100
#define INF (0x3f3f3f3f)
int city[TAM][TAM], custo[TAM], visitados[TAM], n;
void dijkstra(int s, int d) {
int i, atual, minimo;
@thiagopnts
thiagopnts / gist:1507486
Created December 21, 2011 20:06
Popover with ajax
//Selecionando o select pelo ID e configurando o popover.
$("#select").popover({html: "true", trigger: "manual", position: 10, placement: "right"});
$("#select").mouseover(function() {
var self = $(this);
var html = '';
$.get(
'/path/to/get', function(data) {
for(var i = 0; i < data.length; i++) {
html+='<li>'+data[i].info+'</li>';
@thiagopnts
thiagopnts / gist:1507497
Created December 21, 2011 20:09
HTML with popover
<script src="1.4.0/bootstrap-popover.js"></script>
<select id="select" rel="popover" data-original-title="Título do popover"> </select>
function Controller() {
var self = this;
this.infos = [];
var socket = io.connect();
socket.on('news', function(data){
self.infos.push(data);
});
}
class Node:
def __init__(self, key, value):
self.key = key
self.value = value
class HashMap:
def __init__(self):
self.__size = 50
self.__table = [[] for i in range(self.__size)]
import unittest
from hash import HashMap
class HashMapTest(unittest.TestCase):
def setUp(self):
self.hash = HashMap()
def test(self):
import unittest
from hash import HashMap
class HashMapTest(unittest.TestCase):
def setUp(self):
self.hash = HashMap()
def test(self):