Skip to content

Instantly share code, notes, and snippets.

View raphaelkross's full-sized avatar

Rafael Angeline raphaelkross

View GitHub Profile
@raphaelkross
raphaelkross / sample.php
Last active June 28, 2018 06:36
Configure Image Sizes when Theme is Activated
<?php
/**
* Change thumbnail sizes after theme activation
*
* @return void
*/
function theme_prefix_activation() {
// Set default WordPress' sizes.
update_option( 'thumbnail_size_h', 120 );
update_option( 'thumbnail_size_w', 80 );
@raphaelkross
raphaelkross / 0_reuse_code.js
Created May 19, 2017 18:13
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@raphaelkross
raphaelkross / dumb-component.php
Created April 29, 2017 02:49
React Components in PHP
<?php
/*
* Declare example of Agent Profile Component.
*/
namespace App\Agent\Profile;
use App\Agent\Avatar;
use App\Agent\Designations;
use App\Agent\Awards;
@raphaelkross
raphaelkross / genesis-nav.php
Created April 28, 2017 18:01
Genesis Pagination FacetWP
<?php
//* Do NOT include the opening php tag
add_action( 'loop_end', 'custom_replace_genesis_pagination' );
/**
* Replace Genesis' Pagination with FacetWP's.
*/
function custom_replace_genesis_pagination() {
<?php
function fwp_preload_facets() {
?>
<script>
(function($) {
$(document).on('facetwp-refresh', function() {
if (! FWP.loaded && '' == FWP.build_query_string()) {
FWP.facets['product_availability'] = ['americas'];]
FWP.refresh();
}
@raphaelkross
raphaelkross / gist:6ecc582ce7e145beeffbf3f3e5e38d98
Last active February 17, 2017 16:20 — forked from anonymous/gist:f14041f73416fbbc3b7e374a2ae2d279
Having problems getting the sort to show on this page. See line 8. Site is http://thecopperlemon.com/archives/
<?php
/*
Template Name: Archives Page
*/
?>
<?php get_header(); ?>
<main id="main" class="site-main" role="main">
<div class="facetwp-template">
@raphaelkross
raphaelkross / Display Code.php
Last active April 8, 2017 22:12
Ensure Divi Theme functions are declared at Display Code
<?php
// Add before the loop.
include_once get_template_directory() . '/includes/builder/' . 'functions.php';
@raphaelkross
raphaelkross / list.html
Created November 30, 2016 06:45
Vertical Flow
<ul class="StepProgress">
<li class="StepProgress-item is-done"><strong>Award an entry</strong>
Little Text</li>
<li class="StepProgress-item is-done"><strong>Award an entry</strong>
Little Text
<div class="StepProgress-actions">
<a href="#" class="btn pdf">PDF</a>
<a href="#" class="btn xml">XML</a>
</div>
</li>
@raphaelkross
raphaelkross / cases.md
Last active October 5, 2020 19:00
Webdriver + Codeception Cases

Webdriver PHP API workthough

  • Your WebDriverRemoteControl instance is available at:

    $this->driver
    
  • Locating Elements

    • 'findElement(WebDriverBy $by)' -- Find the first element matching the given arguments.
/*
* Formatter for Selenium 2 / WebDriver PHP client.
*/
var subScriptLoader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"].getService(Components.interfaces.mozIJSSubScriptLoader);
subScriptLoader.loadSubScript('chrome://selenium-ide/content/formats/webdriver.js', this);
function useSeparateEqualsForArray() {
return true;
}