Skip to content

Instantly share code, notes, and snippets.

View mauricio's full-sized avatar

Maurício Linhares mauricio

View GitHub Profile
@alankelon eu trabalhei com um cara na Phoebus, Romullo, que era, provavelmente um dos melhores programadores que eu conheci na vida. O cara quebrava todos os galhos que você imaginar, estava sempre ligado nas novidades, mas se enterrou no Delphi dentro da empresa e virou dono de sistema, não saía mais do lugar.
Como ele não existia fora da empresa, não participava de comunidades nem procurava nada, era um ilustre desconhecido pro resto do mundo, apesar de ser super capacitado e de estar ganhando muito menos do que ele realmente merecia.
Infelizmente as pessoas precisam aprender a "se vender" e o currículo é um exemplo claro disso. Quando você tem "comprovação" do que você fez, com código/blog/apresentação/whatever a coisa realmente começa a valer as vistas de alguém que olha o seu currículo.
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
class Tupla <T> {
private final T esquerda;
private final T direita;
public Tupla(T esquerda, T direita) {
@mauricio
mauricio / upload.java
Created June 2, 2011 16:57
Upload a file to OfficeDrop
DefaultHttpClient httpclient = new DefaultHttpClient();
CredentialsProvider credsProvider = new BasicCredentialsProvider();
credsProvider.setCredentials(new AuthScope(AuthScope.ANY_HOST,
AuthScope.ANY_PORT), new UsernamePasswordCredentials("some-user", "some-password"));
httpclient.setCredentialsProvider(credsProvider);
HttpPost httpost = new HttpPost(
"http://192.168.140.17:3000/ze/api/documents.xml");
@mauricio
mauricio / Utils.java
Created July 8, 2011 02:08
Transliterate function for PT-BR
public class Utils {
public static String transliterate( String content ) {
return content.replaceAll( "(ã|á|â)" , "a")
.replaceAll( "(é|ê)", "e" )
.replaceAll( "(í)", "i" )
.replaceAll( "(ó|ô|õ)", "o" )
.replaceAll( "(ú)", "u" );
#!/usr/bin/env ruby
root = File.expand_path( File.join( File.dirname(__FILE__), '..' ) )
Dir.chdir( root )
require 'rubygems'
gem 'daemons'
require 'daemons'
options = {
:dir_mode => :normal,
package br.com.faculdadeidez.loja.utils;
public abstract class ReturningRetryableService<T> {
private int maxRetries = 3;
private int retryCount = 0;
private T result;
public ReturningRetryableService() {
}
sendEmailsAndRecordPoll: function ( req, res, next ){
var supportCode = req.params.code;
var data = req.body;
this.searchSupport(supportCode,
this.setAttendant(
#include "studentinfo.h"
bool compare( const StudentInfo& x, const StudentInfo& y )
{
return x.name() < y.name();
}
StudentInfo::StudentInfo() : midterm(0), final(0) {}
StudentInfo::StudentInfo( double _midterm, double _final, std::vector<double> _homework ) {
this->final = _final;
Unhandled Exception: System.TypeInitializationException: An exception was thrown by the type initializer for OfficeDrop.Core.Api.JsonOfficeDropApi ---> System.TypeInitializationException: An exception was thrown by the type initializer for System.Net.ServicePointManager ---> System.Configuration.ConfigurationErrorsException: Error Initializing the configuration system. ---> System.MissingMethodException: Default constructor not found for type System.Configuration.ExeConfigurationHost. at System.Activator.CreateInstance (System.Type type, Boolean nonPublic) [0x00000] in :0 at System.Activator.CreateInstance (System.Type type) [0x00000] in :0 at System.Configuration.InternalConfigurationSystem.Init (System.Type typeConfigHost, System.Object[] hostInitParams) [0x00000] in :0 at System.Configuration.InternalConfigurationFactory.Create (System.Type typeConfigHost, System.Object[] hostInitConfigurationParams) [0x00000] in :0 at System.Configuration.ConfigurationManager.OpenExeConfigurationInternal (ConfigurationUse
using System;
using System.Net;
using System.Collections.Specialized;
using System.IO;
using System.Collections.Generic;
namespace Core.Api.Http
{
public class Credential {