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
@Shelob9
Shelob9 / serve-side-block.js
Last active February 4, 2024 20:38
Example Gutenberg block with server-side rendering. Gutenberg edit() block creates interface. Gutenberg saves settings automatically, the PHP function passed as `render_callback` to `register_block_type` is used to create HTML for front-end rendering of block.
const { __ } = wp.i18n;
const { registerBlockType } = wp.blocks;
const el = wp.element.createElement;
registerBlockType( 'hiRoy/serverSide', {
title: __( 'Server Side Block', 'text-domain' ),
icon: 'networking',
category: 'common',
attributes: {
@nailkhasipov
nailkhasipov / quick-find.js
Created September 15, 2015 19:10
Quick-find implementation of Princeton Union-Find algorithm on JavaScript
var items = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
var id_array = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
var union = function (p, q) {
var pId = id_array[p];
var qId = id_array[q];
if (items[p] === items[q]) {
return;
<?php
/*
Register Fonts
*/
function studio_fonts_url() {
$font_url = '';
/*
Translators: If there are characters in your language that are not supported
by chosen font(s), translate this to 'off'. Do not translate into your own language.
@irazasyed
irazasyed / Install Composer using MAMP's PHP.md
Last active April 5, 2025 13:08
Instructions on how to change preinstalled Mac OS X PHP to MAMP's PHP Installation and then install Composer Package Management

Change default Mac OS X PHP to MAMP's PHP Installation and Install Composer Package Management


Instructions to Change PHP Installation


First, Lets find out what version of PHP we're running (To find out if it's the default version).

To do that, Within the terminal, Fire this command:

which php