Skip to content

Instantly share code, notes, and snippets.

Avatar

Harcharan Singh bitnbytesio

View GitHub Profile
@bitnbytesio
bitnbytesio / jquery-nested-nav.html
Created Jul 22, 2021
jquery based simple nested navigation
View jquery-nested-nav.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
.d-none {
@bitnbytesio
bitnbytesio / awslogs-agent-setup.py
Created Jul 14, 2021
awslogs agent setup python script for python version 3.8
View awslogs-agent-setup.py
#!/usr/bin/python
# Copyright 2014 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Amazon Software License (the "License"). You may not use
# this file except in compliance with the License. A copy of the License is
# located at http://aws.amazon.com/asl/ or in the "license" file accompanying
# this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
@bitnbytesio
bitnbytesio / example.ts
Last active Feb 21, 2020
Convert Object to GraphQL QueryString
View example.ts
// usage example
import { graphql, GraphqlQuery } from './obj-to-graphql';
const bookingsQuery: GraphqlQuery = {
name: 'bookings',
args: {
page: 1,
filter: { from: '2020-02-02' },
},
select: {
@bitnbytesio
bitnbytesio / setup-nginx-php.sh
Created Jul 14, 2018
Install required stuff/tools for php development on ubuntu
View setup-nginx-php.sh
#!/bin/bash
// note: there is no error handling in this script, recommened way is to execute commands one by one
sudo apt -y update
sudo apt -y upgrade
sudo apt -y install wget
@bitnbytesio
bitnbytesio / mysql-function.sql
Created Jun 29, 2018
My sql function to count similar words in comma seperated string
View mysql-function.sql
DROP FUNCTION IF EXISTS SPLIT_STRING;
DROP FUNCTION IF EXISTS SIMILAR_WORDS;
DELIMITER $$
CREATE FUNCTION SPLIT_STRING(str VARCHAR(255), delim VARCHAR(12), pos INT)
RETURNS VARCHAR(255)
RETURN REPLACE(SUBSTRING(SUBSTRING_INDEX(str, delim, pos),
LENGTH(SUBSTRING_INDEX(str, delim, pos-1)) + 1),
delim, '');