Skip to content

Instantly share code, notes, and snippets.

View abdullah1908's full-sized avatar
🎯
Focusing

Abdullah Ramzan abdullah1908

🎯
Focusing
View GitHub Profile
@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
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( {

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).

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()
@jaredatch
jaredatch / functions.php
Last active October 12, 2024 21:26
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',
@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 );
@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;
@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
*/
@Clorith
Clorith / gist:7675143
Created November 27, 2013 12:50
wp_nav_menu_items filter example
<?php
function theme_menu_append( $items ) {
$prepend = "";
$append = "";
$prepend .= "<li>First item always!</li>";
$append .= "<li>This is the 2nd to last item</li>";
$append .= "<li>This is the very last item</li>";