Skip to content

Instantly share code, notes, and snippets.

View fernandomalmeida's full-sized avatar

Fernando Mendonça de Almeida fernandomalmeida

View GitHub Profile
@fernandomalmeida
fernandomalmeida / main.go
Last active December 3, 2020 01:07 — forked from filewalkwithme/main.go
Listening multiple ports on golang http servers, closing only one port
package main
import (
"context"
"fmt"
"net/http"
"time"
)
func main() {
@fernandomalmeida
fernandomalmeida / markdown_gist_test.md
Created October 19, 2015 18:56
Markdown Gist Test

Markdown Gist Test

Some markdown to test gist capabilities with Markdown and GitHubAPI with that gist.

Some List:

  • First item
  • Second item
@fernandomalmeida
fernandomalmeida / utilizando_struct_union_e_bit_flags.c
Created March 26, 2015 16:41
Explorando as Feature Flags da instrução CPUID
/*
* Trabalho prático II
* Data da entrega: 27/05/2014
* Conteúdo:
* Instrução CPUID, explorar featured flag (tabela 5)
* Formato:
* - Apresentação com descrição e funcionalidade da instrução
* - Implementação de código com comentários
* Referência básica:
* http://datasheets.chipdb.org/Intel/x86/CPUID/24161821.pdf
import unittest
def balance(left, right):
balance.calls += 1
sum_left = sum(left)
sum_right = sum(right)
if sum_left == sum_right:
return 0
else:
@fernandomalmeida
fernandomalmeida / q3.wxm
Created December 2, 2014 23:52
Resolução do Problema XOR utilizando função de base radial
/* [wxMaxima batch file version 1] [ DO NOT EDIT BY HAND! ]*/
/* [ Created with wxMaxima version 11.08.0 ] */
/* [wxMaxima: comment start ]
Essa primeira parte calcula os multiplicadores de lagrange
[wxMaxima: comment end ] */
/* [wxMaxima: input start ] */
rbf(x,i,y) := (%e^(-((x[i]-y).(x[i]-y))/2)) $
@fernandomalmeida
fernandomalmeida / helloFlask.py
Created November 27, 2014 21:00
Hello Flask
from flask import Flask
app = Flask(__name__)
@app.route("/")
def index():
return '<button onclick="window.location=\'helloWorld\'">Say Hello</button>'
@app.route("/helloWorld")
def hello():