Skip to content

Instantly share code, notes, and snippets.

View AbinashBishoyi's full-sized avatar
😊

Abinash Bishoyi AbinashBishoyi

😊
View GitHub Profile
// This file was initially generated by Windows Terminal 1.6.10571.0
// It should still be usable in newer versions, but newer versions might have additional
// settings, help text, or changes that you will not see unless you clear this file
// and let us generate a new one for you.
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",
# -*- mode: ruby -*-
# vi: set ft=ruby :
# To use this script and prepare your build environment, run the following
# command in the same directory as the Vagrantfile.
# B2G_PATH={path to your B2G directory} vagrant up
VAGRANTFILE_API_VERSION = "2"
# This script will be run on the first start and it will set up the build
@AbinashBishoyi
AbinashBishoyi / gist:8018273
Last active December 18, 2018 13:42
Auto Update SVN Repo
#! /bin/bash
REMOTE_REPO="svn://path/to/remote/repo"
LOCAL_REPO="/path/to/local/repo"
REMOTE_REV=`svn info $REMOTE_REPO | grep '^Revision:' | awk '{print $2}'`
LOCAL_REV=`svn info $LOCAL_REPO | grep '^Revision:' | awk '{print $2}'`
if [ $REMOTE_REV -eq $LOCAL_REV ]; then
exit 0;
@AbinashBishoyi
AbinashBishoyi / gist:5238389
Last active December 15, 2015 09:29
Thanks to Aka...
my $qry = "SELECT * FROM table WHERE UPPER(name1) LIKE DECODE(NVL('" . $start . "',0),0,'%" . $contain . "%','" . $start . "%') AND UPPER(name1) LIKE DECODE(NVL('" . $contain . "',0),0,'" . $start . "%','%" . $contain . "%') ORDER BY .....";
@AbinashBishoyi
AbinashBishoyi / gist:3840059
Created October 5, 2012 14:25
awk max min total
awk '{if($2!=""){if(min==""){min=max=$2}; if($2>max) {max=$2}; if($2< min) {min=$2}; total+=$2; count+=1; if($2>10){print $0}}} END {print total, count, min, max}' test_vec.log
@AbinashBishoyi
AbinashBishoyi / gist:3761050
Created September 21, 2012 11:51
Perl Routines to Manipulate CGI input
#!/usr/local/bin/perl
# Perl Routines to Manipulate CGI input
#
# Copyright (c) 1995 Steven E. Brenner
# Permission granted to use and modify this library so long as the
# copyright above is maintained, modifications are documented, and
# credit is given for any use of the library.
#
# Thanks are due to many people for reporting bugs and suggestions
@AbinashBishoyi
AbinashBishoyi / gist:3761047
Created September 21, 2012 11:50
cgi-lib.pl,v 2.18
# Perl Routines to Manipulate CGI input
# cgi-lib@pobox.com
# $Id: cgi-lib.pl,v 2.18 1999/02/23 08:16:43 brenner Exp $
#
# Copyright (c) 1993-1999 Steven E. Brenner
# Unpublished work.
# Permission granted to use and modify this library so long as the
# copyright above is maintained, modifications are documented, and
# credit is given for any use of the library.
#
@AbinashBishoyi
AbinashBishoyi / gist:3761023
Created September 21, 2012 11:44
Subroutine to read CGI input
#!/usr/local/bin/perl
#
# Subroutine to read CGI input.
# Script stuck together from work by S.E.Brenner@bioc.cam.ac.uk
# and ronnie@scs.leeds.ac.uk by nik@scs.leeds.ac.uk
#
# Subroutine &read_input takes and decodes data either from
# QUERY_STRING (for GET method, default) or STDIN (for POST method)
# Returned is an associative array of names and values.
#
@AbinashBishoyi
AbinashBishoyi / gist:3716554
Created September 13, 2012 18:36
CGI POST
#http://www.team2053.org/docs/bashcgi/postdata.html
#This code for getting code from post data is from http://oinkzwurgl.org/bash_cgi and
#was written by Phillippe Kehi <phkehi@gmx.net> and flipflip industries
# (internal) routine to store POST data
function cgi_get_POST_vars()
{
# check content type
# FIXME: not sure if we could handle uploads with this..
[ "${CONTENT_TYPE}" != "application/x-www-form-urlencoded" ] && \
#include<iostream>
#include<stdlib.h>
#include<sys/time.h>
using namespace std;
class quick
{
public:
int partition(int a[],int high ,int low);