Skip to content

Instantly share code, notes, and snippets.

Andre Azevedo Pinto andreazevedo

Block or report user

Report or block andreazevedo

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@andreazevedo
andreazevedo / install_mono.sh
Last active Jul 2, 2019
Install mono on centOS 6.x
View install_mono.sh
$ yum install bison gettext glib2 freetype fontconfig libpng libpng-devel libX11 libX11-devel glib2-devel libgdi* libexif glibc-devel urw-fonts java unzip gcc gcc-c++ automake autoconf libtool make bzip2 wget
$ cd /usr/local/src
$ wget http://download.mono-project.com/sources/mono/mono-3.2.8.tar.bz2
$ tar jxf mono-3.2.8.tar.bz2
$ cd mono-3.2.8
@andreazevedo
andreazevedo / class_definition.js
Created Mar 12, 2013
Good pattern for defining javascript classes.
View class_definition.js
/** Class Foo **/
var Foo = (function () {
// Private variables
var private_number = 200
/** class Constructor **/
var Foo = function () {
this.bar = 0;
};
/** class methods **/
Foo.prototype = {
@andreazevedo
andreazevedo / numbers.scala
Created Sep 25, 2012 — forked from mateusfreira/gist:3781896
Dado um vetor com 'n' números distintos, calcular quantas possibilidades existem para se obter a soma 's'
View numbers.scala
def countSum(numbers: List[Int], expectedResult: Int): Int = {
countSumRecursively(numbers, 0, expectedResult);
}
def countSumRecursively(numbers: List[Int], currentResult: Int, expectedResult: Int): Int = {
if (currentResult == expectedResult)
1
else if ((currentResult > expectedResult) || (numbers.isEmpty))
0
else
@andreazevedo
andreazevedo / nhrollback.cs
Created Sep 20, 2012 — forked from lukemcgregor/nhrollback
Do NHibernate Transactions rollback with parent transaction scope?
View nhrollback.cs
using System;
using System.Data.SqlServerCe;
using System.IO;
using System.Reflection;
using Moq;
using NHibernate;
using NHibernate.ByteCode.Castle;
using NHibernate.Cfg;
using NHibernate.Tool.hbm2ddl;
@andreazevedo
andreazevedo / NaN.htm
Created Aug 16, 2011
Odd NaN feature in JavaScript
View NaN.htm
<html>
<head>
<script>
function printLine(content) {
if (content) {
document.body.innerHTML += content;
}
document.body.innerHTML += "<br/>";
}
@andreazevedo
andreazevedo / octalNumbers.html
Created Aug 12, 2011
JavaScript: octal numbers and strict mode.
View octalNumbers.html
<html>
<head>
<script>
function printLine(content) {
if (content != null) {
document.body.innerHTML += content;
}
document.body.innerHTML += "<br/>";
}
You can’t perform that action at this time.