This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--fuinction to get the square of an integer | |
square::Int->Int | |
square a = a*a | |
--function to find the mid of two integers floor to ,lower if fractional | |
mid::Int->Int->Int | |
mid a b = (a+b) `div` 2 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Configure your favorite diff program here. | |
DIFF="/usr/bin/vimdiff" | |
# Subversion provides the paths we need as the sixth and seventh | |
# parameters. | |
LEFT=${6} | |
RIGHT=${7} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){ | |
"use strict": | |
angular.module('ng-relativeDate',[]) | |
.filter('ngrelativeDate',function(){ | |
/** | |
* [humanreadableDate converts the timestamp into human readable time ] | |
* @param {Int} timestamp - time as number of milliseconds since 1970/01/01: | |
* @return {string} relative time corresponding to timestamp | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
server_name example.sarath.in; | |
access_log /var/log/nginx/example.sarath/access.log; | |
error_log /var/log/nginx/example.sarath/error.log; | |
location ~ ^/assets/ { | |
autoindex on; | |
expires 7d; | |
add_header Last-Modified ""; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -o errexit | |
set -o pipefail | |
set -o nounset | |
args=("${@}") | |
package="${args[0]}" | |
echo -n "Enter your bitbucket username " | |
read user_name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"reflect" | |
) | |
//StructToMap converts a struct to map of string to interface | |
//Its uses the tag 'map' to check the name to be used | |
//if the value is nil no key is added |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"reflect" | |
) | |
//StructToMap converts a struct to map of string to interface | |
//Its uses the tag 'map' to check the name to be used | |
//if the value is nil no key is added |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
outfile="$1" | |
if [ "x$outfile" = "x" ];then | |
echo 'use log_free oufile'; | |
exit 1; | |
fi | |
if [ -t 0 ]; then stty -echo -icanon -icrnl time 0 min 0; fi | |
keypress='' | |
while [ "x$keypress" = "x" ]; do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
SESSION_NAME="kafka" | |
cd /home/kafka/kafka | |
tmux has-session -t ${SESSION_NAME} | |
if [ $? != 0 ] | |
then | |
# Create the session |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# copied from somewhere and tweaked - dont remember the original source | |
############################## | |
# _ | |
# | |_ _ __ ___ _ ___ __ | |
# | __| '_ ` _ \| | | \ \/ / | |
# | |_| | | | | | |_| |> < | |
# \__|_| |_| |_|\__,_/_/\_\ | |
# | |
############################# | |
# |