Skip to content

Instantly share code, notes, and snippets.

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

Alberuni Azad HelloAlberuni

🏠
Working from home
View GitHub Profile
npm run --silent build:package-types && node ./bin/packages/build.js
<--- Last few GCs --->
[46009:0x148008000] 48661 ms: Mark-Compact (reduce) 2046.3 (2085.4) -> 2045.7 (2085.6) MB, 1891.79 / 0.00 ms (average mu = 0.079, current mu = 0.012) allocation failure; scavenge might not succeed
<--- JS stacktrace --->
FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
@HelloAlberuni
HelloAlberuni / .distignore
Created July 22, 2023 02:47
Sample .distignore file
# Folders
/.wordpress-org
/.git
/.github
/blocks/node_modules
# Files
.distignore
.gitignore
/blocks/package.json
@HelloAlberuni
HelloAlberuni / deploy.yml
Created July 22, 2023 02:27
Deploy file with Node Setup & Build process
name: Deploy to WordPress.org
on:
# We only want this action to run when publishing a new release.
release:
# run only when a new release is published not when pre released.
types: [created]
@HelloAlberuni
HelloAlberuni / deploy.yml
Created July 22, 2023 02:19
General plugin deploy file
name: Deploy to WordPress.org
on:
# We only want this action to run when publishing a new release.
release:
# run only when a new release is published not when pre released.
types: [created]
@HelloAlberuni
HelloAlberuni / app.js
Created July 2, 2021 14:34
Custom HTTP library version 2 using Fetch & Promise
let instance = new azHTTPLibrary();
// Make get HTTP request
// instance.get('https://jsonplaceholder.typicode.com/posts')
// .then( res => console.log(res) )
// .catch( err => console.log(err) );
// Make post HTTP request
// instance.post('https://jsonplaceholder.typicode.com/users', { name: 'azadd', username: 'ab_azad' } )
// .then( res => console.log(res) )
@HelloAlberuni
HelloAlberuni / fetch-api.js
Created June 19, 2021 14:30
Replace existing Fetch api practice sandbox with Arrow function
document.getElementById('button1').addEventListener('click', getText );
document.getElementById('button2').addEventListener('click', getJSON );
document.getElementById('button3').addEventListener('click', getExternal );
// fetch data from local .txt file
// normal way
// function getText(e){
// e.preventDefault();
// fetch('test.txt')
// .then(function(res){
@HelloAlberuni
HelloAlberuni / practice-promise.js
Created June 17, 2021 13:31
Practice JS Promise
const posts = [
{title: 'Post 1', body: 'this is post 1'},
{title: 'Post 2', body: 'this is post 2'},
{title: 'Post 3', body: 'this is post 3'},
];
// Callback way
// function createPost(post, callback){
// setTimeout(function(){
// posts.push(post);
@HelloAlberuni
HelloAlberuni / app.js
Created June 16, 2021 13:43
Custom HTTP library with ajax (Practice)
let instance = new azHTTPLibrary;
// GET
// instance.get('https://jsonplaceholder.typicode.com/posts', function(err, response){
// if(err){
// console.log(response);
// } else {
// console.log('Get post...');
// console.log(response);
// }
@HelloAlberuni
HelloAlberuni / app.js
Last active April 9, 2021 10:58
Book List Project Using Vanilla JavaScript
// Book constructor
function Book(title, author, isbn){
this.title = title;
this.author = author;
this.isbn = isbn;
}
// UI Constructor
function UI(){}
@HelloAlberuni
HelloAlberuni / notice.json
Last active January 4, 2021 14:16
Plugin Notices
{
"vapfem": {
"active": false,
"message": "This message comes from the json notices."
},
"nbbfem": {}
}