Skip to content

Instantly share code, notes, and snippets.

View PaulGwamanda's full-sized avatar
💭
Leave the world a little better than you found it

Paul Gwamanda PaulGwamanda

💭
Leave the world a little better than you found it
View GitHub Profile
@PaulGwamanda
PaulGwamanda / Fix object fit cover for IE
Created September 20, 2018 12:03
Fix object fit cover for IE
Fix object fit cover for IE
$('.card-with-image img').each(function () {
var t = $(this),
s = 'url(' + t.attr('src') + ')',
p = t.parent();
t.hide();
if (p.has('img')) {
p.css({
@PaulGwamanda
PaulGwamanda / ExamineIndex.config
Created August 20, 2018 12:55
Examine Index/Search providers for site search, can defined in the UmbracoSettings.config
<?xml version="1.0"?>
<!--
Umbraco examine is an extensible indexer and search engine.
This configuration file can be extended to create your own index sets.
Index/Search providers can be defined in the UmbracoSettings.config
More information and documentation can be found on GitHub: https://github.com/Shazwazza/Examine/
-->
<ExamineLuceneIndexSets>
<!-- The internal index set used by Umbraco back-office - DO NOT REMOVE -->
@PaulGwamanda
PaulGwamanda / ExamineSettings.config
Created August 20, 2018 12:54
Umbraco examine indexer for search engine
<?xml version="1.0"?>
<!--
Umbraco examine is an extensible indexer and search engine.
This configuration file can be extended to add your own search/index providers.
Index sets can be defined in the ExamineIndex.config if you're using the standard provider model.
More information and documentation can be found on GitHub: https://github.com/Shazwazza/Examine/
-->
<Examine>
<ExamineIndexProviders>
@PaulGwamanda
PaulGwamanda / Convert_images_to_numpy_arrays_in_python.py
Created July 3, 2018 09:51
Convert images to numpy arrays in python
#!/usr/bin/env python
from __future__ import print_function
from __future__ import absolute_import
import os
import sys
import shutil
import numpy as np
CONTEXT_LENGTH = 48
@PaulGwamanda
PaulGwamanda / MS-DOS_script_for_creating_files_from_an_array
Created May 30, 2018 12:54
MS-DOS script for creating files from an array
MS-DOS script for creating files (any extension) from an array in a text document.
ie: 'filenames.txt' document contains below list of items:
file-1.html
file-2.html
file-3.html
file-4.html
file-5.html
Open MS-DOS in same folder and run below script
@PaulGwamanda
PaulGwamanda / Material_design_ripple_click_effect .js
Created March 17, 2018 12:16
Material design ripple click effect
<style>
a {
position: relative;
transition: all 0.2s ease;
}
.ink {
display: inline-block;
position: absolute;
background: rgba(155, 155, 155, 0.3);
@PaulGwamanda
PaulGwamanda / Display wordpress template for post meta information.
Created November 16, 2017 12:28
Display wordpress template for post meta information.
/**
* Display template for post meta information.
*
*/
function THEME_posted_on()
{
printf(__('Posted on <a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s" pubdate>%4$s</time></a><span class="byline"> <span class="sep"> by </span> <span class="author vcard"><a class="url fn n" href="%5$s" title="%6$s" rel="author">%7$s</a></span></span>','M247'),
esc_url(get_permalink()),
esc_attr(get_the_time()),
esc_attr(get_the_date('c')),
@PaulGwamanda
PaulGwamanda / Check for any wordpress theme dependencies
Created November 16, 2017 12:26
Check for any wordpress theme dependencies
/**
* Check for any theme dependencies
*
* @return array
*/
function M247_check_theme_dependencies() {
$missing = array();
$plugins = array(
'contact-form-7/wp-contact-form-7.php' => 'Contact Form 7',
'advanced-custom-fields/acf.php' => 'Advanced Custom Fields',
@PaulGwamanda
PaulGwamanda / Dynamic wordpress social media theme options
Last active November 16, 2017 12:28
Dynamic Wordpress Social Media options
/** The list of Social Media options for the site
* This is used to build Theme options to insert each Social Media link and to output it in the theme
* @return array
*/
function ssa_social_media_options()
{
return array(
'facebook' => 'Facebook',
'twitter' => 'Twitter',
'instagram' => 'Instagram',
@PaulGwamanda
PaulGwamanda / wp_bootstrap_navwalker.php
Created November 16, 2017 12:17
Wordpress Bootstrap Navwalker
<?php
/**
* Class Name: wp_bootstrap_navwalker
* GitHub URI: https://github.com/twittem/wp-bootstrap-navwalker
* Description: A custom WordPress nav walker class to implement the Bootstrap 3 navigation style in a custom theme using the WordPress built in menu manager.
* Version: 2.0.4
* Author: Edward McIntyre - @twittem
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
*/