Skip to content

Instantly share code, notes, and snippets.

View Sidsector9's full-sized avatar

Siddharth Thevaril Sidsector9

View GitHub Profile
<?php
/**
* Gift card balance: : $5
* Order total before applying gift card : $30
* Order total after applying gift card : $25 (to be paid using Credit card.)
*/
// Create an order for $25
@Sidsector9
Sidsector9 / php.ini.hbs
Created November 16, 2022 08:00
Working XDebug config Local By flywheel
[PHP]
engine = On
{{#if os.windows}}
extension_dir="{{extensionsDir}}"
{{/if}}
; Maxes
max_execution_time = 1200
max_input_time = 600
max_input_vars = 4000
/**
* This function provides 2 callback functions - before and after.
* `runBefore` is called beforer executing the thousand lines of code and
* `runAfter` is called after executing the thousand lines of code.
*/
function functionThatDoesSomething( name, runBefore, runAfter ) {
/**
* It is important to check the type else it will throw an error.
@Sidsector9
Sidsector9 / web-dev-2018.md
Last active April 17, 2019 14:58
Web Development Tools 2018

Rapid Web Development 2018

1. Grunt vs Gulp vs Webpack

Although Grunt and Gulp are both popular task runners, the Web Development community has moved to module bundlers such as Webpack since it can accomplish the same task as Grunt and Gulp, and in addition to that it can do a lot more.

The benefit of using Webpack is that it enables to work on projects as modules. We can have one webpack.config.js file for every project and use it as a starting point. It will achieve:

  • Code modularization
  • Transpiling ES6 to ES5
  • SCSS to CSS
  • Bundle all JS files into 1 .js file

Frontend UI testing

The frontend UI testing tests whether the contents of Give's features display and function as intended. These tests don't focus on the aesthetics but rather tests the correct output on the webpage and the interactions with it.

How to run the tests?

A sample wordpress.sql is provided within sample-data/ folder which has few sample forms, donations and donors to test in various combinations.

Manual Testing

After setting up the local development environment, running tests manually is fairly simple. All you need it to run

<?php
/**
* Adding a settings field in the already existing settings
* page: general.
*/
add_action( 'admin_init', function() {
/**
* To create a settings field, it needs to be registered first.
* Here we register a settings field called 'brand-name'.
{
// The tab key will cycle through the settings when first created
// Visit http://wbond.net/sublime_packages/sftp/settings for help
// sftp, ftp or ftps
"type": "sftp",
"save_before_upload": true,
"upload_on_save": true,
"sync_down_on_open": false,
<?php
/**
* First we will create a settings page and add the name of the page to the
* admin dashboard
* Hook to be used in `admin_menu`
*/
add_action( 'admin_menu', 'wpgf_menu_page_setup' );
function wpgf_menu_page_setup() {
add_menu_page(