Skip to content

Instantly share code, notes, and snippets.

View kabeer11000's full-sized avatar
💭
Adding Bugs to fix later

Kabeer Jaffri kabeer11000

💭
Adding Bugs to fix later
View GitHub Profile
@kabeer11000
kabeer11000 / search_partial_string_array.php
Created August 7, 2020 20:07 — forked from zuhairkareem/search_partial_string_array.php
Search partial string in an array in PHP
<?php
/**
* First Method.
*/
function array_search_partial($arr, $keyword) {
foreach($arr as $index => $string) {
if (strpos($string, $keyword) !== FALSE)
return $index;
}
}
const someFunction1 = () => {
// Call This Function
console.log('called');
}
const ChildComponent = (props) => {
const [state, useState] = React.useState(0);
const someFunction2 = () => {
// Call This Function
console.log('called');
@kabeer11000
kabeer11000 / youtube_topicIDs.md
Created August 31, 2020 09:32 — forked from stpe/youtube_topicIDs.md
YouTube Topic IDs

Music topics

  • /m/04rlf Music
  • /m/05fw6t Children's music
  • /m/02mscn Christian music
  • /m/0ggq0m Classical music
  • /m/01lyv Country
  • /m/02lkt Electronic music
  • /m/0glt670 Hip hop music
  • /m/05rwpb Independent music
@kabeer11000
kabeer11000 / tokenizer.js
Created September 17, 2020 06:40 — forked from dlebech/tokenizer.js
Keras text tokenizer in JavaScript with minimal functionality
// Public Domain CC0 license. https://creativecommons.org/publicdomain/zero/1.0/
class Tokenizer {
constructor(config = {}) {
this.filters = config.filters || /[\\.,/#!$%^&*;:{}=\-_`~()]/g;
this.lower = typeof config.lower === 'undefined' ? true : config.lower;
// Primary indexing methods. Word to index and index to word.
this.wordIndex = {};
this.indexWord = {};
@kabeer11000
kabeer11000 / package.json
Created September 17, 2020 06:42 — forked from jthomas/package.json
Using TensorFlow.js with MobileNet models for image classification on Node.js
{
"name": "tf-js",
"version": "1.0.0",
"main": "script.js",
"license": "MIT",
"dependencies": {
"@tensorflow-models/mobilenet": "^0.2.2",
"@tensorflow/tfjs": "^0.12.3",
"@tensorflow/tfjs-node": "^0.1.9",
"jpeg-js": "^0.3.4"
@kabeer11000
kabeer11000 / ES6-Setup.md
Created October 4, 2020 14:05 — forked from rahman541/ES6-Setup.md
ES6 Setup with nodemon

ES6 Setup

npm init -y
npm i --save-dev nodemon
npm add babel-preset-env babel-cli

Create a .babelrc config in your project root. Insert the following

{
 "presets": ["env"]
@kabeer11000
kabeer11000 / filterArrayofObjectsFromAnother.js
Created October 16, 2020 21:27
Easy with new ES6 Syntax Second and Third way are more performant i guess....
const a = [{
'id': '1',
'name': 'a1'
}, {
'id': '2',
'name': 'a2'
}, {
'id': '3',
'name': 'a3'
}];
@kabeer11000
kabeer11000 / render-promise-in-react.js
Created October 17, 2020 20:42 — forked from hex13/render-promise-in-react.js
how to render promises in React
//License CC0 1.0: https://creativecommons.org/publicdomain/zero/1.0/
class Deferred extends React.Component {
constructor(props) {
super(props);
this.state = {
value: ''
};
}
componentDidMount() {
@kabeer11000
kabeer11000 / jwtRS256.sh
Created November 17, 2020 07:57 — forked from ygotthilf/jwtRS256.sh
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub
@kabeer11000
kabeer11000 / inline_worker_with_fallback.html
Created December 9, 2020 14:47 — forked from romannurik/inline_worker_with_fallback.html
An example of using simple inline Web Workers with a fallback for browsers that can't support this technique.
<!DOCTYPE html>
<html>
<!--
Copyright 2011 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0