Skip to content

Instantly share code, notes, and snippets.

View EvanAgee's full-sized avatar
🎯
Focusing

Evan Agee EvanAgee

🎯
Focusing
View GitHub Profile
"postcssSorting.config": {
"order": [
"custom-properties",
"dollar-variables",
"at-rules",
"declarations",
{
"type": "at-rule",
"name": "media"
},
@aduth
aduth / stars-block.php
Last active February 15, 2022 04:13
Vue Custom Element Gutenberg Block
<?php
// NOTE: It would normally be recommended to split a block's JavaScript
// implementation to a separate file, but is authored here in a single
// file for convenience's sake.
//
// See: https://github.com/WordPress/gutenberg/pull/2791
/**
* Plugin Name: Stars Block
@rajendra89
rajendra89 / my-first-custom-element
Created August 9, 2017 07:17
replace your my-first-custom-element.php with code below.
replace your my-first-custom-element.php with code below.

GifHub

Gone are the days of simple text-based comments in Github!

Squerge

![image](http://i.giphy.com/3og0IuECgoRILJUAfu.gif)

image

Merge

![image](https://media.giphy.com/media/3o7btP3U51GnFkj4f6/giphy.gif)

@yosukehasumi
yosukehasumi / git-auto-deploy.md
Last active July 25, 2023 20:07
Setting Up Git-Auto-Deploy on Digital Ocean

Install software-properties-common

sudo apt-get install software-properties-common

Add Repo

sudo add-apt-repository ppa:olipo186/git-auto-deploy
// Shortcode
// source : https://wpbakery.atlassian.net/wiki/pages/viewpage.action?pageId=524362
if(!function_exists('carousel_content')){
function carousel_content( $atts, $content = null ) {
return '<div class="owl-carousel content-carousel content-slider">'.do_shortcode($content).'</div>';
}
add_shortcode('carousel_content', 'carousel_content');
}
@JedWatson
JedWatson / KeystoneApiExample.md
Last active July 26, 2021 11:29
Example of how to scaffold API endpoints for Posts in a Keystone project (based on the yo keystone example).

This is an example of how to scaffold API endpoints to list / get / create / update / delete Posts in a Keystone website.

It's a modification of the default project created with the yo keystone generator (see https://github.com/JedWatson/generator-keystone)

Gists don't let you specify full paths, so in the project structure the files would be:

routes-index.js        -->    /routes/index.js         // modified to add the api endpoints
routes-api-posts.js    -->    /routes/api/posts.js     // new file containing the Post API route controllers
// Get The Page ID You Need
get_option( 'woocommerce_shop_page_id' );
get_option( 'woocommerce_cart_page_id' );
get_option( 'woocommerce_checkout_page_id' );
get_option( 'woocommerce_pay_page_id' );
get_option( 'woocommerce_thanks_page_id' );
get_option( 'woocommerce_myaccount_page_id' );
get_option( 'woocommerce_edit_address_page_id' );
get_option( 'woocommerce_view_order_page_id' );
get_option( 'woocommerce_terms_page_id' );
@retgef
retgef / pug-bomb.php
Created June 24, 2012 07:46
Pug Bomb API Endpoint WordPress Plugin
<?php
/*
Plugin Name: Pug Bomb API Endpoint
Description: Adds an API endpoint at /api/pugs/$n_pugs
Version: 0.1
Author: Brian Fegter
Author URL: http://coderrr.com
*/
class Pugs_API_Endpoint{
@them0nk
them0nk / rspec_rails_cheetsheet.rb
Created March 23, 2012 03:39
Rspec Rails cheatsheet (include capybara matchers)
#Model
@user.should have(1).error_on(:username) # Checks whether there is an error in username
@user.errors[:username].should include("can't be blank") # check for the error message
#Rendering
response.should render_template(:index)
#Redirecting
response.should redirect_to(movies_path)