Skip to content

Instantly share code, notes, and snippets.

View macariojames's full-sized avatar
💭
Making things. All the things. Ahh!

Macario James macariojames

💭
Making things. All the things. Ahh!
View GitHub Profile
@PurpleBooth
PurpleBooth / README-Template.md
Last active April 22, 2024 11:45
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@paaljoachim
paaljoachim / welcome-panel-php
Last active January 23, 2020 13:46
Creating a new welcome Dashboard panel. I made a tutorial on adding a Dashboard widget: http://easywebdesigntutorials.com/creating-a-custom-dashboard-widget/
/*****************************
*Add a custom Welcome Dashboard Panel
*****************************/
function my_welcome_panel() {
?>
<div class="top-welcome-panel-content">
<div class="top-welcome-panel-logo" style="height: 120px; padding: 5px;text-align: center;">
<!-- Adds a logo top left-->
@mediabeastnz
mediabeastnz / Staging&ProductionUsingGit
Last active December 1, 2022 14:47
Staging and Production Server using Git.
If you are running a large website where you will need to test new features on a seperate url before pushing them live then the following instructions are for you ;)
For this example imagine your url is apple.com and you want a development/staging site on a subdomain which is dev.apple.com
#Setup#
1. First thing you'll want to do is go ahead and create your website in plesk and add the subdomain dev.apple.com at the same time.
2. ssh into the server e.g. $ ssh username@ipaddress
3. Once logged in cd into the private directory (this will be where all git repos are stored) e.g. $ cd ~/private
4. Create the main repo e.g. $ git init --bare apple.git
5. Now to clone this new repo on your local machine. $ git clone ssh://username@ipaddres/~/private/apple.com
@derekconjar
derekconjar / wordpress-firebase.php
Last active May 30, 2022 15:38
An example of using Firebase and WordPress together. The idea is to use WP's custom post types and metaboxes to make content management easy, and sync with Firebase so that your websites have access to a real-time JSON feed of your custom data.
<?php
/**
* All custom functions should be defined in this class
* and tied to WP hooks/filters w/in the constructor method
*/
class Custom_Functions {
// Custom metaboxes and fields configuration
@carolineschnapp
carolineschnapp / gist:9122054
Last active March 7, 2024 08:53
Order form to use in a page or collection template.
{% comment %}
Source: https://gist.github.com/carolineschnapp/9122054
If you are not on a collection page, do define which collection to use in the order form.
Use the following assign statement, replace 'your-collection-handle-here' with your collection handle.
{% assign collection = collections.your-collection-handle-here %}
Use the assign statement outside of this comment block at the top of your template.
{% endcomment %}
{% paginate collection.products by 100 %}
@ryansechrest
ryansechrest / .htaccess
Last active September 30, 2022 19:53
Sample configuration files for WordPress as Git submodule.
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
# Prevent requests to index.php from being rewritten
RewriteRule ^index\.php$ - [L]
# Prefix specified PHP files with 'wordpress'
RewriteRule ^((wp-login|xmlrpc)\.php) wordpress/$1 [R=301,L]
@justintadlock
justintadlock / register-post-type.php
Last active October 22, 2023 05:55
Help file when registering post types.
<?php
# Register custom post types on the 'init' hook.
add_action( 'init', 'my_register_post_types' );
/**
* Registers post types needed by the plugin.
*
* @since 1.0.0
* @access public
@charleslouis
charleslouis / custom-search-acf-wordpress.php
Last active December 15, 2023 09:11
PHP - Wordpress - Search - wordpress custom search function that encompasses ACF/advanced custom fields and taxonomies and split expression before request
<?php
/**
* [list_searcheable_acf list all the custom fields we want to include in our search query]
* @return [array] [list of custom fields]
*/
function list_searcheable_acf(){
$list_searcheable_acf = array("title", "sub_title", "excerpt_short", "excerpt_long", "xyz", "myACF");
return $list_searcheable_acf;
}
@nseo
nseo / upload2facebook
Created June 11, 2012 14:07
A sample code to upload an image file to facebook using Facebook javascript sdk
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<title>Hello FB</title>
</head>
<body>
<div id="fb-root"></div>
<div id="fb-content"></div>
<div>
@keeguon
keeguon / countries.json
Created April 5, 2012 11:11
A list of countries in JSON
[
{name: 'Afghanistan', code: 'AF'},
{name: 'Åland Islands', code: 'AX'},
{name: 'Albania', code: 'AL'},
{name: 'Algeria', code: 'DZ'},
{name: 'American Samoa', code: 'AS'},
{name: 'AndorrA', code: 'AD'},
{name: 'Angola', code: 'AO'},
{name: 'Anguilla', code: 'AI'},
{name: 'Antarctica', code: 'AQ'},