Skip to content

Instantly share code, notes, and snippets.

View VarunBatraIT's full-sized avatar
🎯
Focusing

Varun Batra VarunBatraIT

🎯
Focusing
View GitHub Profile
<?php
/**
* This is the model class for table "vb_products".
*
* The followings are the available columns in table 'vb_products':
* @property integer $products_id
* @property integer $products_type
* @property integer $products_quantity
* @property integer $products_moq
@VarunBatraIT
VarunBatraIT / annoying.js
Created September 13, 2012 17:56 — forked from Kilian/annoying.js
How to be an asshole
/**
* Annoying.js - How to be an asshole to your users
*
* DO NOT EVER, EVER USE THIS.
*
* Copyright (c) 2011 Kilian Valkhof (kilianvalkhof.com)
* Visit https://gist.github.com/767982 for more information and changelogs.
* Visit http://kilianvalkhof.com/2011/javascript/annoying-js-how-to-be-an-asshole/ for the introduction and weblog
* Check out https://gist.github.com/942745 if you want to annoy developer instead of visitors
*
@VarunBatraIT
VarunBatraIT / spicegems.md
Last active December 27, 2021 11:40
PHP Assignment SpiceGems

Collect all the under roots (Square Root: For instance 4 under root is 2) of all the positive integers between 1 to 100000 which are prime numbers in an array. Randomize the order of an array such that only ONE random triplet is in original order with exact same indices.

For instance, if input would have been 50, under root array would have been as following in ascending order:

$input = 50;
$ordered_output = [1, 2, 3, 5, 7];

and after randomize output would have been any one of the following but random everytime:

version: '2'
services:
mysql:
image: bitnami/mysql:latest
container_name: MySQL
user: "0:0"
restart: always
environment:
MYSQL_ROOT_PASSWORD: "mbstf"
MYSQL_AUTHENTICATION_PLUGIN: mysql_native_password
@VarunBatraIT
VarunBatraIT / Assignment.md
Last active October 24, 2018 14:50
Basic Assignment

1

  • Use php to create 100 divs such that all the values inside divs must be a prime number in descending order starting from 99991.
  • Write a jQuery function which will hide the div is a user clicks on any of the prime number.

2

  • Create a PhysicalProduct class with all the necessary functionality.
  • Create a DigitalProduct class with all the necessary functionality.
  • Create a Cart class with all the necessary functionality which supports multiple carts - can add PhysicalProduct and DigitalProduct.
@VarunBatraIT
VarunBatraIT / php7_pthreads_en.sh
Last active July 28, 2018 11:07
PHP7 with Thread
#!/bin/bash
apt-get update
apt-get install -y \
bison \
autoconf \
build-essential \
pkg-config \
git-core \
Array.from(document.querySelectorAll('*'))
.reduce(function(pre, dom){
var evtObj = getEventListeners(dom)
Object.keys(evtObj).forEach(function (evt) {
if (typeof pre[evt] === 'undefined') {
pre[evt] = 0
}
pre[evt] += evtObj[evt].length
})
return pre

Situation

  • HTML body is black.
  • Head only has jQuery

Assignment

  • Create 100 li under ul - numbered 1,2,3 to 100 using jQuery
  • if clicked on any li, that li will be removed using jQuery

Situation

  • We have three files - page.html, sidebard.html, main.html

page.html

  • Head only has jQuery
  • Body has three divs with id timestamp, sidebar and main.

main.html content

Please upload codes to github and share the url when you start the test.

Two different domains and Two Systems Client/Server.

  • Please consider that your backend is running at backendserver.com and html/css/jQuery OR angular/react app is running at frontendserver.com
  • Your server doesn't contain any codes of client. Both are mutually independent of each other. One laravel app is just a rest api, other app is nothing but simple forms built with angular/react or just jquery.

Three databases

  • information_db will contain a table shops with columns shop_name, db_name & reqeusts like

|id|shop_name|db_name|requests|