Skip to content

Instantly share code, notes, and snippets.

@cshtdd
cshtdd / setup_elastic_search_java.sh
Created January 16, 2019 12:04
Setup all the Java versions Elastic Search needs to compile
#!/bin/bash
# desired java versions
JAVA_VERSION_11=11.0.1-open
JAVA_VERSION_10=10.0.2-open
JAVA_VERSION_9=9.0.4-open
JAVA_VERSION_8=8.0.192-zulu

Keybase proof

I hereby claim:

  • I am cshtdd on github.
  • I am camilin87 (https://keybase.io/camilin87) on keybase.
  • I have a public key whose fingerprint is E96A FDA6 5B38 4269 52EB EFC6 22E2 BE7F 4BBE 3543

To claim this, I am signing this object:

@cshtdd
cshtdd / p.c
Created February 25, 2020 15:32
This is a sample C program. It proves what happens when referencing the memory address of a stack variable declared inside a function
/*
# This is a sample C program
# It proves what happens when referencing the
# memory address of a stack variable declared inside a function
# compile and run the program
gcc -o program1 p.c && ./program1
*/
@cshtdd
cshtdd / tree.rb
Created February 25, 2020 16:22
Find the kth smallest element in a binary tree
#!/bin/ruby
class Node
attr_accessor :value
attr_accessor :left
attr_accessor :right
def initialize(value)
self.value = value
end
@cshtdd
cshtdd / serialize-tree.rb
Created March 23, 2020 15:40
How to Serialize/Deserialize a binary tree
# Binary tree
# 1. value (int)
# 2. left node (Tree or nil)
# 3. right node (Tree or nil)
class Tree
attr_accessor :value
attr_accessor :left_node
attr_accessor :right_node