Skip to content

Instantly share code, notes, and snippets.

View jeccb-zz's full-sized avatar

Jessica Chaves jeccb-zz

View GitHub Profile
class Hamming
def self.compute(type_a, type_b)
raise ArgumentError if (type_a.size != type_b.size)
count = 0;
type_a.each_char.with_index do |x, x_index|
type_b.each_char.with_index do |z, z_index|
if (x_index != z_index)
next;
end
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>React - Aula 01</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.23/browser.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.13.3/react-with-addons.js"></script>
</head>
<body>
<div id="aula-01"></div>
#!/usr/bin/env ruby
class CashMachine
available_cash = [100, 50, 20, 10]
banknotes = {};
print "What value you whish take out? "
value = gets.chomp
value = value.to_i
#!/usr/bin/env ruby
class CashMachine
available_cash = [100, 50, 20, 10]
banknotes = {};
print "What value you whish take out? "
value = gets.chomp
value = value.to_i
2.3.0 :001 > bacon_slices = %w(bacon)
 => [“bacon”]
2.3.0 :002 > bacon_slices.cycle(2).to_a
 => [“bacon”, “bacon”]
@jeccb-zz
jeccb-zz / tmux-cheatsheet.markdown
Created August 10, 2018 14:17 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname

Setup

$ apt-get install vim
$ apt-get install ack-grep

$ git clone [email protected]:jeccb/Dotfiles.git

Follow the instructions in readme of Dotfiles repo.

let mapleader=","
set nocompatible "Use Vim settings, rather then Vi settings (much better!).
filetype off " required
syntax on " syntax highlight
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
@jeccb-zz
jeccb-zz / update_gitTag.txt
Created August 13, 2019 13:41 — forked from danielestevez/gist:2044589
GIT Commit to an existing Tag
1) Create a branch with the tag
git branch {tagname}-branch {tagname}
git checkout {tagname}-branch
2) Include the fix manually if it's just a change ....
git add .
git ci -m "Fix included"
or cherry-pick the commit, whatever is easier
git cherry-pick {num_commit}
// Avoid Single Letter Names
String n = "use name instead"
// Avoid Acronyms
String cra = 'no idea what this is'
// Avoid Abbreviations
String cat = "cat or category??"
// Avoid Meaningless Names