Skip to content

Instantly share code, notes, and snippets.

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

Jamil Ahmed jimi008

🏠
Working from home
View GitHub Profile
@carlodaniele
carlodaniele / block.json
Created September 28, 2022 14:56
An example Gutenberg block for Kinsta readers
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 2,
"name": "ka-example-block/ka-example-block",
"version": "0.1.0",
"title": "Kinsta Academy Block",
"category": "widgets",
"icon": "superhero-alt",
"description": "An example block for Kinsta Academy students",
"supports": {
# DSND - Lesson 2 - Quiz 8 / 2
# Let's say that we have a line whose equation is y = -0.6x + 4. For the point (x,y) = (-5, 3), apply the square trick to get the new equation for the line, using a learning rate of alpha = 0.01alpha=0.01.
# Report your answer in the form y = w_1x + w_2, substituting appropriate values for w_1 and w_2.
a = 0.01
w1 = -0.6
w2 = 4
p = -5
@daveajones
daveajones / jsonfeed2rss.php
Last active August 15, 2023 21:06
Convert JSONFeed to RSS
<?php
//Convert JSONfeed to RSS in a single function as a drop-in to make adding JSONfeed
//support to an aggregator easier
function convert_jsonfeed_to_rss($content = NULL, $max = NULL)
{
//Test if the content is actual JSON
json_decode($content);
if( json_last_error() !== JSON_ERROR_NONE) return FALSE;
@lukecav
lukecav / DNS Prefetch domains
Last active March 30, 2024 20:53
WP Rocket - Advanced Options Prefetch DNS requests examples
//maps.googleapis.com
//maps.gstatic.com
//fonts.googleapis.com
//fonts.gstatic.com
//ajax.googleapis.com
//apis.google.com
//google-analytics.com
//www.google-analytics.com
//ssl.google-analytics.com
//youtube.com
@matthiaspabst
matthiaspabst / 404.php
Last active April 14, 2022 12:32
Twenty Fifteen - Custom 404 page for a custom post type
<?php
/**
* The template for displaying 404 pages (not found)
*
* @package WordPress
* @subpackage Twenty_Fifteen
* @since Twenty Fifteen 1.0
*/
get_header(); ?>
@oxguy3
oxguy3 / deploy.php
Last active August 5, 2023 20:21
Script used to automatically deploy from GitHub to a cPanel shared hosting server
<?php
/**
* deploy.php by Hayden Schiff (oxguy3)
* Available at https://gist.github.com/oxguy3/70ea582d951d4b0f78edec282a2bebf9
*
* No rights reserved. Dedicated to public domain via CC0 1.0 Universal.
* See https://creativecommons.org/publicdomain/zero/1.0/ for terms.
*/
// random string of characters; must match the "Secret" defined in your GitHub webhook
@noelboss
noelboss / git-deployment.md
Last active June 12, 2024 00:28
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.

anonymous
anonymous / gfcptaddonbase.php
Created April 25, 2016 12:19
Temp fix for Multiselect of Custom Taxonomies in Gravity Forms + Custom Post Types 3.1
<?php
if (!class_exists('GFCPTAddonBase')) {
/*
* Base class for the GFCPT Addon. All common code is in here and differences per version are overrided
*/
class GFCPTAddonBase {
protected $_has_tag_inputs = false;
@danielpataki
danielpataki / compatibility.js
Last active October 17, 2020 00:06
jQuery in WordPress
/* Regular jQuery */
$('.hideable').on('click', function() {
$(this).hide();
})
/* Compatibility Mode */
jQuery('.hideable').on('click', function() {
jQuery(this).hide();
})
@feedmac
feedmac / selection2PNG.jsx
Created February 9, 2016 13:33
Photoshop JS script for quickly exporting selection to PNG.
app.displayDialogs = DialogModes.NO;
var pngSaveOptions = new PNGSaveOptions();
pngSaveOptions.compression = 9;
pngSaveOptions.interlaced = false;
var hasSelection;
var docRef;
var artLayer;
var width = app.activeDocument.width;