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 / split.py
Created May 4, 2022 08:19 — forked from dmorrison42/split.py
Podcast Splitting Script
#!/usr/bin/env python
# Dependencies:
# ffmpeg: https://www.ffmpeg.org/download.html
# fpcalc: https://acoustid.org/chromaprint
from datetime import datetime
import os
import os.path
import json
import math
import shutil
class NeuMF(torch.nn.Module):
def __init__(self, config):
super(NeuMF, self).__init__()
#mf part
self.embedding_user_mf = torch.nn.Embedding(num_embeddings=self.num_users, embedding_dim=self.latent_dim_mf)
self.embedding_item_mf = torch.nn.Embedding(num_embeddings=self.num_items, embedding_dim=self.latent_dim_mf)
#mlp part
self.embedding_user_mlp = torch.nn.Embedding(num_embeddings=self.num_users, embedding_dim=self.latent_dim_mlp)
@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 / 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'
}];
@andy0130tw
andy0130tw / rocket-loader-nice.js
Last active September 21, 2024 07:00
Try to de-obfusticate CloudFlare Rocket Loader script as of 20190521.
'use strict';
!function() {
/**
* @return {?}
*/
function t$jscomp$0() {
return "cf-marker-" + Math.random().toString().slice(2);
}
/**
* @return {undefined}
@dmorrison42
dmorrison42 / split.py
Last active May 4, 2022 08:19
Podcast Splitting Script
#!/usr/bin/env python
# Dependencies:
# ffmpeg: https://www.ffmpeg.org/download.html
# fpcalc: https://acoustid.org/chromaprint
from datetime import datetime
import os
import os.path
import json
import math
import shutil
class NeuMF(torch.nn.Module):
def __init__(self, config):
super(NeuMF, self).__init__()
#mf part
self.embedding_user_mf = torch.nn.Embedding(num_embeddings=self.num_users, embedding_dim=self.latent_dim_mf)
self.embedding_item_mf = torch.nn.Embedding(num_embeddings=self.num_items, embedding_dim=self.latent_dim_mf)
#mlp part
self.embedding_user_mlp = torch.nn.Embedding(num_embeddings=self.num_users, embedding_dim=self.latent_dim_mlp)
@naoki-sawada
naoki-sawada / client.js
Last active August 30, 2024 00:40
Simple socket.io room and auth example
const io = require('socket.io-client');
const socket = io('http://localhost:3000', {
transportOptions: {
polling: {
extraHeaders: {
'Authorization': 'Bearer abc',
},
},
},
@rahman541
rahman541 / ES6-Setup.md
Last active May 22, 2023 04:04
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"]
@jayphelps
jayphelps / package.json
Last active June 29, 2024 15:53
TypeScript output es2015, esm (ES Modules), CJS, UMD, UMD + Min + Gzip. Assumes you install typescript (tsc), rollup, uglifyjs either globally or included as devDependencies
{
"scripts": {
"build": "npm run build:es2015 && npm run build:esm && npm run build:cjs && npm run build:umd && npm run build:umd:min",
"build:es2015": "tsc --module es2015 --target es2015 --outDir dist/es2015",
"build:esm": "tsc --module es2015 --target es5 --outDir dist/esm",
"build:cjs": "tsc --module commonjs --target es5 --outDir dist/cjs",
"build:umd": "rollup dist/esm/index.js --format umd --name YourLibrary --sourceMap --output dist/umd/yourlibrary.js",
"build:umd:min": "cd dist/umd && uglifyjs --compress --mangle --source-map --screw-ie8 --comments --o yourlibrary.min.js -- yourlibrary.js && gzip yourlibrary.min.js -c > yourlibrary.min.js.gz",
}
}