Skip to content

Instantly share code, notes, and snippets.

View miguelgazela's full-sized avatar

Miguel Oliveira miguelgazela

View GitHub Profile
@miguelgazela
miguelgazela / Graph.h
Created January 1, 2013 17:11
C++ template class for Graphs and related algorithms (Dijsktra's, Bellman-Ford, etc.)
/*
* Graph.h
*/
#ifndef GRAPH_H_
#define GRAPH_H_
#include <vector>
#include <list>
#include <queue>
using namespace std;
@miguelgazela
miguelgazela / JS_Module_Pattern_Template.js
Last active August 29, 2015 13:57
JS Module Pattern Template
var myNamespace = (function () {
var myPrivateVar, myPrivateMethod;
// A private counter variable
myPrivateVar = 0;
// A private function which logs any arguments
myPrivateMethod = function( foo ) {
console.log( foo );

Sublime Text 2 - Useful Shortcuts

Tested in Mac OS X: super == command

Open/Goto


  • super+t: go to file
  • super+ctrl+p: go to project
  • super+r: go to methods
@miguelgazela
miguelgazela / gist:7b87f4cb020f4925f301
Created March 15, 2015 17:32
Front-end CSS - Sofia Reis
<style>
div { height: 100px; width: 100px; display: inline-block; }
#one { border: 2px solid black; }
#two { position: relative; border: 2px dashed black; top: 20px; left: 20px; }
#three { border: 2px dotted black; }
/* o que acontece ao acrescentar a seguinte regra? */
/* #two { position: absolute; } */
</style>
@miguelgazela
miguelgazela / gist:bc817746faeb2cef7575
Created March 15, 2015 17:44
Front-end CSS - Anaís
<style>
div { height: 100px; width: 100px; margin-bottom: 10px; }
#one { border: 2px solid black; }
#two { border: 2px dashed black; display: none; }
#three { border: 2px dotted black; }
/* o que acontece ao acrescentar a seguinte regra? */
/* #two { display: block; visibility: hidden; } */
</style>
@miguelgazela
miguelgazela / gist:0e433ed0ccf284c3beeb
Created March 15, 2015 17:51
Front-end CSS - João Bernardino
<style>
div { height: 100px; width: 100px; border: 1px solid black; display: inline-block; }
div:nth-child(2n) {
border: 1px dashed black;
}
div:nth-child(3) {
border: 1px dotted black;
}
@miguelgazela
miguelgazela / gist:860248d11fed095a27b0
Created March 15, 2015 18:24
Front-end CSS João Monteiro
<style>
.row > div { height: 100px; width: 100px; border: 1px solid black; }
div:not(.row) { display: inline-block; }
.row > div:before {
content: "";
display: block;
height: 50px;
width: 50px;
@miguelgazela
miguelgazela / gist:97ea262b72a8c2b1965d
Last active August 29, 2015 14:17
Front-end CSS - João Pereira
<style>
div {
height: 50px;
width: 100px;
border: 1px dashed black;
margin-bottom: 10px;
}
div:nth-child(2n) {
position: relative;
@miguelgazela
miguelgazela / gist:229d3ccd48da7fefce13
Created March 16, 2015 21:56
Front-end CSS - Joana Ferreira
<style>
div {
border: 1px solid black;
width: 100px;
height: 50px;
margin: 0 auto;
margin-bottom: 10px;
position: relative;
}
@miguelgazela
miguelgazela / gist:96bfc3d43c8de94e3ae5
Created March 16, 2015 21:59
Front-end CSS - Luís Melo
<style>
div {
border: 1px solid black;
width: 100px;
height: 50px;
margin: 0 auto;
margin-bottom: 10px;
position: relative;
}