Skip to content

Instantly share code, notes, and snippets.

View promatik's full-sized avatar
🌊

António Almeida promatik

🌊
View GitHub Profile
@promatik
promatik / monty-hall-simulation
Created April 7, 2015 14:32
Monty Hall Simulation
function montyhallSimulation(playerChangeOpt, testcases)
{
playerChangeOpt = typeof playerChangeOpt !== 'undefined' ? playerChangeOpt : true;
testcases = typeof testcases !== 'undefined' ? testcases : 100;
var right = 0, wrong = 0;
for(i=0 ; i<testcases ; i++) {
var carPos = Math.floor(Math.random()*3);
var playerOpt = Math.floor(Math.random()*3);
@promatik
promatik / facebook-share.html
Created April 15, 2013 02:38
Simple Facebook Share Button, very easy to replicate. Example here: http://promatik.no.sapo.pt/data/facebook-share.html
<!DOCTYPE html>
<html>
<head>
<title>Simple Facebook Share Button</title>
<style>
.fb-share-div {
float: left;
height: 18px!important;
border-radius: 3px;
border: 1px solid #CAD4E7;
@promatik
promatik / pt-PT.php
Created April 6, 2013 03:08
UserCake v2.0.2 pt-PT - Portuguese Language Translation
<?php
/*
UserCake Version: 2.0.2
http://usercake.com
Portuguese Translation
*/
/*
%m1% - Dymamic markers which are replaced at run time by the relevant index.
*/