Skip to content

Instantly share code, notes, and snippets.

@cijogeorge
cijogeorge / vim_hive_syntax.sh
Created November 23, 2017 05:21
HQL syntax highlighting in Vim
mkdir -p ~/.vim/syntax
wget -O ~/.vim/syntax/hive.vim https://raw.githubusercontent.com/autowitch/hive.vim/master/syntax/hive.vim
echo "au BufNewFile,BufRead *.hql set filetype=hive expandtab" >> ~/.vimrc
echo "au BufNewFile,BufRead *.q set filetype=hive expandtab" >> ~/.vimrc
@cijogeorge
cijogeorge / scripting.md
Last active November 11, 2017 18:53
Fun Scripting Problems with Solutions

Fun scripting problems and their solutions

Note: These code snippets were written and tested in 2008.

FYI: There are some challenging fun problems towards the end. Do check those out.

1. Convert all lower case to upper and vice versa.

tr "[a-z] [A-Z]" "[A-Z] [a-z]" < file

@cijogeorge
cijogeorge / trie.md
Created November 11, 2017 17:58
Trie Data Structure Implementation in C

Trie Data Structure Implementation in C

Note: This piece of code was written and tested in 2008.

#include<stdio.h>
#include<stdlib.h>
struct trie
{
 struct trie *alpha[26];
@cijogeorge
cijogeorge / t9.md
Last active February 23, 2022 10:41
T9 Predictive Text Implementation in C

T9 Predictive Text Implementation in C

Note: This piece of code was written and tested in 2008.

/* =================

Dependency: This program needs a file called t9.dic, A file with lots of words to populate our t9 trie structure. All in small letter no spaces no other characters Terminated by a line with only a 0 (zero)