Skip to content

Instantly share code, notes, and snippets.

View joaorafaelm's full-sized avatar
🏠
Working from home

João joaorafaelm

🏠
Working from home
View GitHub Profile
#include <stdio.h>
#include <stdlib.h>
int calculateValor(int valor, int sub);
int main()
{
int valor;
int sub[] = {100, 50, 20, 10, 2, 1};
puts("DIGITE UM VALOR:");
@joaorafaelm
joaorafaelm / upper2lower.sh
Created October 2, 2014 03:39
upper to lower
#!/bin/bash
for arquivos in $(ls $1) ;
do
novoarquivo=`echo $arquivos | tr \[:upper:\] \[:lower:\]`
mv "$1/$arquivos" "$1/$novoarquivo"
done
#!/bin/bash
#
# Aluno: João Rafael
#
# Pede o nome do arquivo
# parametro: @
function pedeArquivo {
echo -n "Digite o nome do arquivo: "
read arquivo
@joaorafaelm
joaorafaelm / .tmux.conf
Last active September 9, 2015 12:31
ubuntu 15
# UTF-8
set -g status-utf8 'on'
# 256 colors
set -g default-terminal 'screen-256color'
# Disable base64 copy of selection
set-option -s set-clipboard off
# Default shell
@joaorafaelm
joaorafaelm / RPNEvaluator.java
Last active September 8, 2015 20:42
Infix/postfix expression parser
import java.util.Stack;
import java.util.StringTokenizer;
import java.util.Scanner;
import java.util.EmptyStackException;
/**
* Classe para transformar infix para postfix e aplicar parser RPN.
* @author João Rafael
* Referências:
* [Infix to Postfix] http://people.cs.clemson.edu/~turner/courses/cs102/spring98/section2/assignments/asg4/InfixToPostfix.java
@joaorafaelm
joaorafaelm / .tmux.conf
Last active September 8, 2015 20:29
mac osx yosemite
##
## Basic Options
##
set-option -g default-terminal "screen-256color"
# UTF-8
set -g utf8 on
set -g status-utf8 on
@joaorafaelm
joaorafaelm / goinst.sh
Created October 24, 2015 22:33 — forked from jmervine/goinst.sh
Installing GoLang - Ubuntu 12.04.3 LTS \n \l
#!/usr/bin/env bash
#
# Example usage:
#
# $ VERSION=1.3 sudo ./goinst.sh
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root" 1>&2
exit 1
fi
class RingCacher:
"""
Cache de mensagens com valor fixo
"""
def __init__(self, size):
"""
Inicia uma lista de tamanho fixo
@param size: tamanho da lista
@return: void
"""
@joaorafaelm
joaorafaelm / cracklepop.py
Created April 16, 2016 23:28
Crackle pop in python
"""
A program that prints out the numbers 1 to 100 (inclusive).
If the number is divisible by 3, print Crackle instead of the number.
If it's divisible by 5, print Pop.
If it's divisible by both 3 and 5, print CracklePop.
"""
for number in range(1, 101):
if number % 15 == 0:
print ("CracklePop")
continue
@joaorafaelm
joaorafaelm / System Design.md
Created April 18, 2016 12:48 — forked from vasanthk/System Design.md
System Design Cheatsheet

#System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

##Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?