Skip to content

Instantly share code, notes, and snippets.

View tamirazrab's full-sized avatar

Tamir Azrab tamirazrab

  • JazzCash
  • Pakistan
  • 05:49 (UTC +05:00)
View GitHub Profile
@tamirazrab
tamirazrab / server.js
Created May 14, 2022 05:13
Hapi POST request test.
'use strict'
const Hapi = require('hapi')
const Boom = require('boom')
const init = async () => {
const server = Hapi.server({
port: 3000,
host: 'localhost'
const tlLeave = gsap.timeline({
defaults: { duration: 0.75, ease: "Power2.easeOut" },
});
const tlEnter = gsap.timeline({
defaults: { duration: 0.75, ease: "Power2.easeOut" },
});
//Make the functions for the leave and enter animations
const leaveAnimation = (current, done) => {
const product = current.querySelector(".image-container");
section {
margin-top: 4rem;
}
.image {
width: 100%;
height: 25rem;
}
img {
.modal-backdrop {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100vh;
background: rgba(0, 0, 0, 0.75);
z-index: 10;
}
class Rectangle
{
int left, right, up, down;
}
public class Main
{
@tamirazrab
tamirazrab / dateDiff.ts
Created October 10, 2021 18:48 — forked from RienNeVaPlus/dateDiff.ts
🕤 dateDiff() - returns a detail object about the difference between two dates
/**
* ☃ dateDiff "Snowman Carl" (http://stackoverflow.com/questions/13903897)
* Returns a detail object about the difference between two dates
*
* When providing custom units, provide them in descending order (eg week,day,hour; not hour,day,week)
*
* @param {Date} dateStart - date to compare to
* @param {Date|string} [dateEnd=new Date()] - second date, can be used as unit param instead
* @param {...string} [units=Object.keys(dateDiffDef)] - limits the returned object to provided keys
*/
@tamirazrab
tamirazrab / ideavimrc
Created July 31, 2021 17:27
Untested configurations for webstorm.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => General
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" vim options {{{
set number
set relativenumber
set ignorecase
set smartcase
set iskeyword
@tamirazrab
tamirazrab / cpp.json
Last active September 23, 2020 16:57
Simple but useful snippets for cpp.
{
"Boiler Code":{
"prefix": "inc",
"body": [
"#include <iostream>\n",
"using namespace std;\n",
"int main() {",
"\t$0",
"\treturn 0; // Good to go",
"}"
@tamirazrab
tamirazrab / fastPC.md
Created July 29, 2020 08:40
A cute little trick to boot up in just 10 seconds or even less.

Regedit and hit Enter.

HKEY_LOACAL_MECHINE\SYSTEM\CurrentControlSet\Control\ContentIndex

Key Called “Startup Delay” Double Click On It.

@tamirazrab
tamirazrab / subSet-knapSack.cpp
Created July 18, 2020 07:30
Time complexity is same as it is in simple brute force approach not efficient according to run time.
#include <iostream>
#include <stdio.h>
using namespace std;
bool subSet( int ar[] , int sum, int size ) {
int results [ size + 1 ] [ sum + 1 ];
// wmemset( &results [ 0 ] [ 0 ] , 0 , sizeof( results ));
for( int i = 1; i < size + 1; ++i ) {