Skip to content

Instantly share code, notes, and snippets.

View thiagopnts's full-sized avatar
phew

Thiago Pontes thiagopnts

phew
View GitHub Profile
p {
font-family: Consolas, monaco, monospace;
}
span {
border-left: 2px solid;
}
.cursor {
-webkit-animation: blink .75s linear infinite;
@thiagopnts
thiagopnts / puzzle.py
Last active October 22, 2021 06:17
The 8 puzzle problem implementation in python, using A* with hamming distance + moves as f(x)
# -*- coding: utf-8 -*-
from heapq import heappush, heappop
from random import shuffle
import time
class Solver:
def __init__(self, initial_state=None):
self.initial_state = State(initial_state)
self.goal = range(1, 9)
#include <vector>
#include <iostream>
#include <string>
class Person
{
public:
Person(std::string const& name): name(name) {}
std::string getName() {
@thiagopnts
thiagopnts / bitfield.c
Created November 10, 2013 12:53
Bit field example
#include <stdio.h>
typedef struct
{
unsigned int a: 1;
unsigned int b: 1;
unsigned int c: 1;
} type;
int main()
<!doctype html>
<html ng-app>
<head>
<link href="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet">
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js"></script>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<style type="text/css" media="all">
.bigger {
font-size: 4.5em;
@thiagopnts
thiagopnts / .zshrc
Last active December 19, 2015 05:39
My .zshrc file
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
#ZSH_THEME="jreese"
ZSH_THEME="candy"
class BinaryHeap:
"""Binary Heap implementation"""
def __init__(self):
"""
Initializing the heap with some values
T
__/ \__
@thiagopnts
thiagopnts / test.txt
Created June 16, 2013 01:53
the description for this gist
updated file contents
@thiagopnts
thiagopnts / TableInstanceListing.js
Last active December 18, 2015 13:18
the description for this gist
;(function() {
var TableInstanceListing = function(id) {
$.getJSON('entities/' + id + '/instances', function(jsonObj) {
draw(jsonObj);
});
var buildTableHead = function(json, table) {
tHead = $('<thead>');
;(function(){
var UIRootWidget = (function() {
var cache = new WidgetCache();
var render = function() {
$.getJSON('entities', function(entities) {
draw(entities);
});
};
var itemClicked = function(entity) {