Skip to content

Instantly share code, notes, and snippets.

View rajasharan's full-sized avatar

Raja Sharan Mamidala rajasharan

View GitHub Profile
call plug#begin()
Plug 'pangloss/vim-javascript'
Plug 'leafgarland/typescript-vim'
Plug 'gregsexton/MatchTag'
Plug 'bling/vim-airline'
Plug 'tpope/vim-projectionist'
Plug 'vim-scripts/HTML-AutoCloseTag'
Plug 'tpope/vim-endwise'
Plug 'google/vim-searchindex'
@rajasharan
rajasharan / app.js
Last active August 29, 2015 14:12
javascript canvas ripple effect
$(function() {
console.log('now running');
var canvas = document.querySelector('#canvas');
var ctx = canvas.getContext('2d');
var h = 150;
var w = 300;
var start = 0.0;
var radius = 0;
package com.sample.test
import java.io.IOException;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@rajasharan
rajasharan / functors-monads.md
Last active October 11, 2017 03:24
Simple Functor and Monad example for string manipulation

Functors & Monads in simple JS

Consider this contrived example of string manipulation. We want to convert a string to uppercase and append "!".

Procedural style code:

function test(str) {
  return str.toUpperCase() + "!";
}
@rajasharan
rajasharan / git-commands.md
Last active March 8, 2019 19:52
common git commands I usually use

Always double check remotes

git remote -v

Always track remotes

git branch -u <remote>/<branch>
@rajasharan
rajasharan / bytes.js
Last active July 29, 2017 14:34
bit level manipulation in javascript
const R = require('ramda');
/*
* https://cryptopals.com/sets/1/challenges/1
*/
const HEX_DIGITS = [ "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F" ];
const HEX_TO_BINARY_MAP = {
"0": "0000",
"1": "0001",
@rajasharan
rajasharan / applicative.md
Last active October 11, 2017 03:25
Intuition for Applicatives (<$>)

Intuition for Applicatives

Consider below program for sequencing commands

sequence : [IO a] -> IO [a]
sequence [] = return []
sequence (c:cs) = do
  x  <- c
  xs <- cs
 return (x:xs)
hardstatus alwayslastline
#hardstatus string "%{= g} %{= w}%-Lw%{=r}%n%f* %t%{-}%+LW"
hardstatus string '%{= kG}[%{G}%H%? %1`%?%{g}][%{= kw}%-w%{+b yk} %n*%t%?(%u)%? %{-}%+w %=%{g}][%{B}%m/%d %{W}%C%A%{g}]'
defscrollback 5000
bindkey "^x" remove
bind x remove
bind l focus right
bind h focus left
@rajasharan
rajasharan / spring-boot-quick-setup.md
Last active July 21, 2018 16:09
Spring-boot hands-on lab

Step 0 - Verify java & mvn are installed on the system

  • $ java -version
  • $ mvn -version

Step 1 - Generate simple maven archetype project

$ mvn archetype:generate -DgroupId=com.mycompany.app -DartifactId=my-app -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false 

Step 2 - Configure maven compiler plugin

@rajasharan
rajasharan / CNTLM.md
Last active July 31, 2022 18:23
CNTLM proxy setup