Skip to content

Instantly share code, notes, and snippets.

View shah-smit's full-sized avatar
🎯
Focusing

Smit Shah shah-smit

🎯
Focusing
View GitHub Profile
@shah-smit
shah-smit / HelloBitWise.java
Last active May 1, 2022 06:17
Bit Wise Java Beginners
package com.quiz.box.quizservice;
/**
* Notes: ~0 is equals to -1
*/
public class HelloBitWise {
public static void main(String[] args) {
System.out.println("Print Whether a number is Odd or Even:");
printOddOrEven(5);
@shah-smit
shah-smit / gist:3934d1a14c4b2e3af53c3e82215e3665
Created September 15, 2021 16:34
Episode 2: CloudFormation and AWS CDK
import * as apigw from '@aws-cdk/aws-apigateway';
import * as lambda from '@aws-cdk/aws-lambda';
import { CfnOutput, Construct, Stack, StackProps } from '@aws-cdk/core';
import dynamodb = require('@aws-cdk/aws-dynamodb');
import * as path from 'path';
import * as cdk from '@aws-cdk/core';
export class CdkCloudFormationAppreciationDashboardStack extends cdk.Stack {
public readonly urlOutput: CfnOutput;
@shah-smit
shah-smit / README.md
Last active August 23, 2020 05:51
Generate Basic Authorization Header

Authorization Header

In order to consume the API, you will need to pass the Authorization header in the request. The header is generated via the below logic.

The Authorization header consists of username and password which will be provided by the admins or maintainer of this site. However in order not to pass the username and password in the plain text, you will have to encode the value using Base64 library.

Base64 Transformation in different languages

For Java, you may use the below line:

This file has been truncated, but you can view the full file.
travis_fold:start:worker_info
Worker information
hostname: 58a7ac78-f90e-4305-8ff9-6e67eccdc666@1.worker-com-85fb98c46b-nsc9t.gce-production-3
version: v6.2.1 https://github.com/travis-ci/worker/tree/4e3246c044eb4915c2378ffacd0b3d3ed0136bba
instance: travis-job-7c14b494-a664-4203-b0e2-9b6d48f014ee travis-ci-garnet-trusty-1512502259-986baf0 (via amqp)
startup: 6.536699975s
travis_fold:end:worker_info
travis_time:start:104b1415
travis_time:end:104b1415:start=1571659364226929031,finish=1571659364422099908,duration=195170877,event=no_world_writable_dirs
travis_time:start:0fc710b0
@shah-smit
shah-smit / first.sh
Created July 6, 2018 12:56
I wrote my first Bash Script with a updating Loader.
#!/bin/bash
# Author : Teddy Skarin
# 1. Create ProgressBar function
# 1.1 Input is currentState($1) and totalState($2)
function ProgressBar {
# Process data
let _progress=(${1}*100/${2}*100)/100
let _done=(${_progress}*4)/10
let _left=40-$_done
@shah-smit
shah-smit / BST.java
Created April 14, 2018 10:32
Binary Search Tree
public class BST {
static TreeNode bst;
public static void main(String[] args){
bst = new TreeNode(10, new TreeNode(9), new TreeNode(11));
add(12);
add(1);
add(3);
System.out.println(bst);
remove(1);
System.out.println(bst);
@shah-smit
shah-smit / Readme.md
Last active December 11, 2017 12:27
Recognizer

Recognizer

bot.recognizer(new builder.LuisRecognizer(luisAppUrl));

replace with

bot.recognizer(basicQnAMakerDialog)
.recognizer(luisrecognizer);
@shah-smit
shah-smit / readme.md
Created November 25, 2017 08:21
Android HOME

export ANDROID_HOME=/usr/local/Caskroom/android-sdk/3859397 export JAVA_HOME=/Library/Java/Home export ANDROID_HOME=/usr/local/Caskroom/android-sdk/3859397 export JAVA_HOME=/Library/Java/Home

export ANDROID_SDK_ROOT=$ANDROID_HOME

export ANDROID_HOME=//android-sdk-macosx export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools export PATH=$PATH:/Android/android-sdk-mac_x86/tools

@shah-smit
shah-smit / stack.java
Created November 23, 2017 04:39
ArrayList implemented through Array
import java.io.*;
public class Stack
{
Node[] stack;
public Stack(){
stack = new Node[0];
}
public void pop(){
@shah-smit
shah-smit / index.html
Created November 13, 2017 15:47
Bot Libre Script
<script type='text/javascript' src="https://www.botlibre.com/scripts/sdk.js"></script>
<script type='text/javascript>
SDK.applicationId = "8084411693033336948";
var sdk = new SDKConnection();
var web = new WebAvatar();
web.connection = sdk;
web.avatar = "14071666";
web.voice = "";
web.voiceMod = "";
web.width = "250";