Skip to content

Instantly share code, notes, and snippets.

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

Hercules Merscher bitmaybewise

🏠
Working from home
View GitHub Profile
@bitmaybewise
bitmaybewise / CaesarCipher.py
Created June 2, 2012 23:28
Python Caesar Cipher
#!/usr/bin/python
# Filename: CaesarCipher.py
# Author: Hercules Lemke Merscher
class CaesarCipher(object):
''' Cifra de Cesar.'''
def encrypt(self, msg, key):
if msg == None: return None
@bitmaybewise
bitmaybewise / JCriptoCesar.java
Created June 2, 2012 23:32
Java Caesar Cipher
import java.util.Scanner;
/**
* Programa simples que implementa a cifra Cesar.
* -> Contem bloco principal com exemplo de funcionamento.
*
* Mais informacoes:
* http://pt.wikipedia.org/wiki/Cifra_de_C%C3%A9sar
*
* @author Hercules Lemke Merscher
@bitmaybewise
bitmaybewise / twitter_api.rb
Created August 15, 2012 01:30
Twitter API
require "rubygems"
require "rest_client"
require "json"
# usando API do twitter para recuperar ultimos 3 twitts de @hlmerscher
url = "https://api.twitter.com/1/statuses/user_timeline.json?include_rts=true&screen_name=hlmerscher&count=3"
data = JSON.parse( RestClient.get url )
# imprimindo cada twitt
data.each {|twitt| puts "#{twitt['text']}" }
@bitmaybewise
bitmaybewise / Jokenpo.java
Created September 29, 2012 00:14
Jokenpo: From DojoPuzzles
/**
* @Author: Hercules Lemke Merscher
* Jokenpo
* http://dojopuzzles.com/problemas/exibe/jokenpo/
*/
enum Play {
ROCK, SCISSORS, PAPER
}
enum Result {
@bitmaybewise
bitmaybewise / FizzBuzz.cs
Created September 29, 2012 01:53
FizzBuzz: From DojoPuzzles
/*
* FizzBuzz
* http://dojopuzzles.com/problemas/exibe/fizzbuzz/
*/
using System;
using System.Text;
namespace FizzBuzz
{
@bitmaybewise
bitmaybewise / fizzbuzz.rb
Created December 10, 2012 22:51
FizzBuzz inline. It's bad.
100.times {|n| puts (if n % 3 == 0 && n % 5 == 0; 'FizzBuzz'; elsif n % 3 == 0; 'Fizz'; elsif n % 5 == 0; 'Buzz'; else; n; end)}
@bitmaybewise
bitmaybewise / git-commands.md
Last active October 13, 2015 20:48
Git commands

List deleted files and removes each

$ git ls-files -d | xargs git rm

Show a text-based graphical representation

$ git log --graph

Ignoring changes in tracked files

<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8" />
<title>Audio and video</title>
</head>
<body>
<!-- Audio -->
<audio src="musica.ogg" controls="true" autoplay="true" />
@bitmaybewise
bitmaybewise / InferenciaDeTipo.cs
Last active December 14, 2015 13:18
Tipagem fraca/forte e inferência de tipo
using System;
public class InferenciaDeTipo
{
public static void Main(String[] args)
{
int valor1 = 10;
String valor2 = "Valor";
var permitido1 = 1;