Skip to content

Instantly share code, notes, and snippets.

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

Mohamed ELIDRISSI elidrissidev

🏠
Working from home
View GitHub Profile
@elidrissidev
elidrissidev / most_used_folder_names_npm_packages.js
Last active February 22, 2023 21:22
A Deno script that fetches the mostly commonly used folder names in popular NPM packages. Read the blog post: https://www.elidrissi.dev/posts/2023/02/most-used-folder-names-npm-packages/
import packages from "./packages.json" assert { type: "json" };
const NPM_REGISTRY_API_URL = "https://registry.npmjs.com";
const GITHUB_API_URL = "https://api.github.com";
const fallbackRepoURL = {
yarn: 'https://github.com/yarnpkg/yarn'
};
const directories = new Map();
@elidrissidev
elidrissidev / script.js
Created January 30, 2021 18:35
Datatables order with top cells & search with bottom cells
$('table').DataTable({
orderCellsTop: true,
ajax: {
url: 'http://jsonplaceholder.typicode.com/users',
dataSrc: '',
},
columns: [
{ data: 'id' },
{ data: 'name' },
{ data: 'username' },
@elidrissidev
elidrissidev / script.js
Created August 2, 2020 10:10
JsTree example with lazy loading and checked state cascading turned off
$(document).ready(function() {
$('.jstree').jstree({
core: {
data: {
url: function(node) {
return node.id === '#' ?
'categories.json' :
`categories-${node.id}.json`;
}