Skip to content

Instantly share code, notes, and snippets.

View iamaamir's full-sized avatar
🏠
Working from home

Aamir khan iamaamir

🏠
Working from home
  • Postman
  • New Delhi
  • 02:08 (UTC +05:30)
  • LinkedIn in/itsaamir
View GitHub Profile
import { useEffect, useState } from 'react';
// this func do not cover all the cases
function debounce(func, wait = 100) {
let timeout;
return function(...args) {
clearTimeout(timeout);
timeout = setTimeout(() => {
func.apply(this, args);
}, wait);
// Sum Numbers over an array
const sum = array => array.reduce((acum, number) => {
return acum + number;
}, 0);
console.log('01', { sum: sum([ 1, 5, 9 ]) });
// Sum Numbers multiplied by a factor
const sumProduct = array => array.reduce((acum, pair) => {
const [ number, factor ] = pair;
@iamaamir
iamaamir / stringCompress.js
Created February 3, 2020 06:31
simplest string compression in js
// https://stackoverflow.com/questions/4570333/string-compression-in-javascript
function en(c){var x='charCodeAt',b,e={},f=c.split(""),d=[],a=f[0],g=256;for(b=1;b<f.length;b++)c=f[b],null!=e[a+c]?a+=c:(d.push(1<a.length?e[a]:a[x](0)),e[a+c]=g,g++,a=c);d.push(1<a.length?e[a]:a[x](0));for(b=0;b<d.length;b++)d[b]=String.fromCharCode(d[b]);return d.join("")}
function de(b){var a,e={},d=b.split(""),c=f=d[0],g=[c],h=o=256;for(b=1;b<d.length;b++)a=d[b].charCodeAt(0),a=h>a?d[b]:e[a]?e[a]:f+c,g.push(a),c=a.charAt(0),e[o]=f+c,o++,f=a;return g.join("")}
var compressed=en("http://www.ScriptCompress.com - Simple Packer/Minify/Compress JavaScript Minify, Fixify & Prettify 75 JS Obfuscators In 1 App 25 JS Compressors (Gzip, Bzip, LZMA, etc) PHP, HTML & JS Packers In 1 App PHP Source Code Packers Text Packer HTML Packer or v2 or v3 or LZW Twitter Compress or More Words DNA & Base64 Packer (freq tool) or v2 JS JavaScript Code Golfer Encode Between Quotes Decode Almost Anything Password Protect Scripts HTML Minifier v2 or En
import React, { useEffect } from 'react';
import ReactJWPlayer from 'react-jw-player';
import { playerScript } from 'config';
// import { Analytics } from "functions/utils/Analytics";
import { buildArtimediaParams } from 'functions/helpers/artimedia';
import { dispatchGalaxyEvent } from './PlayerAnalytics';
import useEvtListener from 'functions/hooks/useEvtListener';
/****************************************
Author: aamirkhan180@gmail.com
github @iamaamir
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html style="width:100%;font-family:helvetica, 'helvetica neue', arial, verdana, sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;padding:0;Margin:0;">
<head>
<meta charset="UTF-8">
<meta content="width=device-width, initial-scale=1" name="viewport">
<meta name="x-apple-disable-message-reformatting">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta content="telephone=no" name="format-detection">
<title>AKSHAY TRITIYA 2</title>
<!--[if (mso 16)]>
@iamaamir
iamaamir / index.html
Created May 31, 2020 12:46
basic login form
<html>
<title>Login</title>
<head>
<link rel="stylesheet" href="style.css" />
<link
href="https://fonts.googleapis.com/css2?family=Poppins:wght@300&display=swap"
rel="stylesheet"
/>
<script src='script.js'></script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html style="width:100%;font-family:helvetica, 'helvetica neue', arial, verdana, sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;padding:0;Margin:0;"><head><meta content="width=device-width, initial-scale=1" name="viewport"><meta charset="UTF-8"><meta name="x-apple-disable-message-reformatting"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta content="telephone=no" name="format-detection"><title>Email Signature</title> <!--[if (mso 16)]><style type="text/css"> a {text-decoration: none;} </style><![endif]--> <!--[if gte mso 9]><style>sup { font-size: 100% !important; }</style><![endif]--> <!--[if !mso]><!-- --><link href="https://fonts.googleapis.com/css?family=Roboto:400,400i,700,700i" rel="stylesheet"> <!--<![endif]--><style type="text/css">
@media only screen and (max-width:600px) {p, ul li, ol li, a { font-size:16px!important; line-height:200%!importa
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import pandas_datareader as web
import datetime as dt
from sklearn.preprocessing import MinMaxScaler
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense, Dropout,LSTM
function betterTypeOf (obj) {
return Object.prototype.toString.call(obj).slice(8, -1).toLowerCase();
}
🗣 Commented on #1 in mtmeyer/figma-react-hooks
❗️ Opened issue #1889 in evanw/esbuild
❌ Closed PR #20 in serverwentdown/file-manager
🗣 Commented on #20 in serverwentdown/file-manager
💪 Opened PR #22 in serverwentdown/file-manager