start new:
tmux
start new with session name:
tmux new -s myname
create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "[email protected]"
/* A function to return class for each Bootstrap navbar elements */ | |
// FIND DESCRIPTION BELOW THE CODE | |
$(function() { | |
$( "#navbar" ).click(function() { | |
$( "ul li" ).each(function( index ) { | |
var class_name = $( this ).attr("class"); | |
if( class_name === "active" || class_name === "inactive"){ | |
console.log( index + ": " + $( this ).attr("class") ); | |
} |
# Fizz-Buzz Ruby | |
# FIND DESCRIPTION BELOW THE CODE | |
puts "Enter a number (integer): " | |
n = gets.chomp.to_i | |
i = 1 | |
n.times do | |
if i%3 == 0 || i%5 ==0 | |
if i%3 == 0 && i%5 == 0 | |
puts "FizzBuzz" |
# Count occurrences | |
# FIND DESCRIPTION BELOW THE CODE | |
def countDuplicates array | |
puts array.select{|x| array.count(x) > 1} | |
.each_with_object(Hash.new(0)) {|num,counts| counts[num] += 1} | |
.each_value.to_a.uniq | |
end | |
# Usage | |
# countDuplicates([1,3,1,4,5,6,3,2,4,4,6,7,6,7,8,8,9,7,7]); |