Skip to content

Instantly share code, notes, and snippets.

View zalom's full-sized avatar
😎
Building stuff

Zlatko Alomerovic zalom

😎
Building stuff
View GitHub Profile
@zalom
zalom / tmux-cheatsheet.markdown
Created April 8, 2017 12:34 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@zalom
zalom / multiple_ssh_setting.md
Created December 18, 2016 14:16 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "[email protected]"
@zalom
zalom / install_phantomjs.md
Created October 20, 2016 19:27
How to install PhantomJS 2.1.1

How to install PhantomJS on Ubuntu

Version: 2.1.1

Platform: x86_64

First, install or update to the latest system software.

sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev
@zalom
zalom / returnClass.js
Last active May 9, 2016 08:28
jQuey return each element's class
/* 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") );
}
@zalom
zalom / fizz-buzz.rb
Last active May 9, 2016 08:26
Coding Test - Fizz Buzz
# 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"
@zalom
zalom / count-duplicates.rb
Last active May 9, 2016 08:26
Coding Test - Return a number of distinct values that occur two or more times in an array
# 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]);