Skip to content

Instantly share code, notes, and snippets.

Ido Kanner ik5

  • :::1
Block or report user

Report or block ik5

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
ik5 / colors.go
Last active Nov 5, 2019
Simple golang expirement with ANSI colors
View colors.go
package main
// <- will not display the colors
import "fmt"
const (
InfoColor = "\033[1;34m%s\033[0m"
NoticeColor = "\033[1;36m%s\033[0m"
WarningColor = "\033[1;33m%s\033[0m"
ErrorColor = "\033[1;31m%s\033[0m"
DebugColor = "\033[0;36m%s\033[0m"
ik5 / time_format.go
Created Nov 9, 2016
A full example of all possible time formats in Golang
View time_format.go
package main
import (
func main() {
fmt.Println("Times: ")
t := time.Now()
ik5 /
Created Jul 26, 2019
Creating 10 workers, takes the host ip using docker
#!/usr/bin/env bash
declare -i min=0
declare -i max=10
host=$(ip -4 addr show docker0 | grep -Po 'inet \K[\d.]+')
for (( c=min; c<max; c++ )) do
echo "Going to start worker # $c"
docker run\
ik5 / language-layout.vue
Created Jul 22, 2019
solving layout changes in Vue.js
View language-layout.vue
<ul class="language-selector">
v-for="(language, idx) in $i18n.availableLocales"
:class="{selected: language === $i18n.locale}"
<a @click="changeLayout(language, $t(`languages.list[${idx}].bidi`))>
ik5 / custom_json_unmarshal.go
Created Jun 25, 2019
Example of custom unmarshal of JSON in golang
View custom_json_unmarshal.go
package main
import (
type To []string
ik5 / schema-bad
Created Jun 25, 2019
simple schema for blog post
View schema-bad
From - String
To - String/List of string
Message - String
View tmux-cheatsheet.markdown

tmux shortcuts & cheatsheet

start new:


start new with session name:

tmux new -s myname
ik5 / int_to_ip.rb
Created Jun 5, 2019
short script to convert 32 bit integer to IPv4
View int_to_ip.rb
#!/usr/bin/env ruby
require 'ipaddr'
ARGV.each do |int|
puts "#{int} = #{, Socket::AF_INET).to_s}"


  • C-a == Ctrl-a
  • M-a == Alt-a


:q        close
:w        write/saves
:wa[!]    write/save all windows [force]
:wq       write/save and close
ik5 / gist:65de721ca495fa1bf451
Last active Mar 30, 2019 — forked from bradleypeabody/gist:185b1d7ed6c0c2ab6cec
golang, convert UTF-16 to UTF-8 string
View gist:65de721ca495fa1bf451
package main
import "fmt"
import "unicode/utf16"
import "unicode/utf8"
import "bytes"
func main() {
b := []byte{
You can’t perform that action at this time.