Skip to content

Instantly share code, notes, and snippets.

View abdullah1908's full-sized avatar
🎯
Focusing

Abdullah Ramzan abdullah1908

🎯
Focusing
View GitHub Profile
@mohandere
mohandere / wp-auto-installer.js
Last active November 5, 2023 19:10
Wordpress auto installer script PHP
;(function($){
/*
Script Name: WP Auto Installer
Author: Mohan Dere
Version: 1.0
Description : This script install new wordpress setup, create database with tables with content & run search replace database for new urls.
Last Update: 13 Mar 15
*/
@Fitoussi
Fitoussi / gjm.min.js
Created December 16, 2015 23:56
Wp Job Geolocation
jQuery(document).ready(function($) {
//default values
var thisPrefix = 'gjm';
var thisForm = false;
var thisTarget = false;
var addressField = false;
var prevAddressField = false;
var latField = false;
var lngField = false;
@Fitoussi
Fitoussi / wpjm-geolocation-radius-dropdown.php
Last active February 5, 2019 16:39
WP Job Manager Geolocation - Modify Radius Dropdown
function gjm_radius_dropdown( $output, $radius, $gjm_object ) {
$output = '';
$output .= '<div class="'.$gjm_object->prefix.'-filter-wrapper '.$gjm_object->prefix.'-radius-wrapper radius dropdown '.$gjm_object->prefix.'-filters-count-'.esc_attr( $gjm_object->filters['filters_count'] ).'">';
$output .= '<select name="'.$gjm_object->prefix.'_radius" class="'.$gjm_object->prefix.'-filter" id="'.$gjm_object->prefix.'-radius">';
foreach ( $radius as $value ) {
$value = esc_attr( $value );
@jaredatch
jaredatch / functions.php
Last active January 19, 2026 23:55
WordPress Search Autocomplete using admin-ajax.php
<?php
/**
* Enqueue scripts and styles.
*
* @since 1.0.0
*/
function ja_global_enqueues() {
wp_enqueue_style(
'jquery-auto-complete',
var $form = $('form#test-form'),
url = 'https://script.google.com/macros/s/abcdefghijklmnopqrstuvwxyz1234567890/exec'
$('#submit-form').on('click', function(e) {
e.preventDefault();
var jqxhr = $.ajax({
url: url,
method: "GET",
dataType: "json",
data: $form.serializeObject()

Strings

String.prototype.*

None of the string methods modify this – they always return fresh strings.

  • charAt(pos: number): string ES1

    Returns the character at index pos, as a string (JavaScript does not have a datatype for characters). str[i] is equivalent to str.charAt(i) and more concise (caveat: may not work on old engines).

const path = require( 'path' );
const webpack = require( 'webpack' );
const ExtractTextPlugin = require( 'extract-text-webpack-plugin' );
// const BrowserSyncPlugin = require( 'browser-sync-webpack-plugin' );
// Set different CSS extraction for editor only and common block styles
const blocksCSSPlugin = new ExtractTextPlugin( {
filename: './blocks/css/blocks.style.css',
} );
const editBlocksCSSPlugin = new ExtractTextPlugin( {
@AliceWonderMiscreations
AliceWonderMiscreations / AWMFontBuilder.php
Last active April 29, 2018 15:14
A Google Font generator that allows use of a mirror
<?php
declare(strict_types=1);
/**
* Plugin Name: AWM Google Font Builder
* Plugin URI: https://gist.github.com/AliceWonderMiscreations/b0071e48a27a536142ce38bf6868336b
* Description: Provides a class theme developers can use to build a Google
* Webfont URI
* Version: 0.82
* Requires PHP: 7.0
@pento
pento / php-block.js
Last active January 20, 2026 00:20
Converting a shortcode to a block: this method is fast to do, but a mediocre UX. You should only use this as a stopgap until you can implement a full block UI.
// License: GPLv2+
var el = wp.element.createElement,
registerBlockType = wp.blocks.registerBlockType,
ServerSideRender = wp.components.ServerSideRender,
TextControl = wp.components.TextControl,
InspectorControls = wp.editor.InspectorControls;
/*
* Here's where we register the block in JavaScript.
@timogoosen
timogoosen / docker-compose.yml
Created October 20, 2018 21:47
Added Elasticsearch plus a volume for Elasticsearch's data. The normal Elasticsearch config is for an ephermeral Elasticsearch setup.
version: "3"
services:
mariadb:
image: wodby/mariadb:$MARIADB_TAG
container_name: "${PROJECT_NAME}_mariadb"
stop_grace_period: 30s
environment:
MYSQL_ROOT_PASSWORD: $DB_ROOT_PASSWORD
MYSQL_DATABASE: $DB_NAME