Skip to content

Instantly share code, notes, and snippets.

Stephen Mullen thewirelessguy

Block or report user

Report or block thewirelessguy

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
thewirelessguy / ConnectivityExtension.kt
Created Jan 16, 2020
Android Kotlin extension to check network connectivity
View ConnectivityExtension.kt
import android.content.Context
import android.os.Build
val Context.isConnected: Boolean
get() {
val connectivityManager = this.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager
return when {
thewirelessguy / SwipeRefreshLayoutExt.kt
Created Oct 18, 2019
SwipeRefreshLayout Kotlin extensions
View SwipeRefreshLayoutExt.kt
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout
fun SwipeRefreshLayout?.start() {
this?.apply {
isRefreshing = true
isEnabled = false
thewirelessguy / VerticalTextView.kt
Created Oct 15, 2019
VerticalTextView that extends AppCompatTextView
View VerticalTextView.kt
import android.content.Context
import android.text.BoringLayout
import android.text.Layout
import android.text.TextUtils
import android.util.AttributeSet
import android.view.Gravity
import androidx.appcompat.widget.AppCompatTextView
thewirelessguy / create_admin_user.php
Created Mar 20, 2018
Create new Magento admin user programmatically. Edit and add the php file below to the root of your Magento folder. Run it in the browser and the user will be created.
View create_admin_user.php
# Create new Magento admin user programmatically.
try {
$user = Mage::getModel('admin/user')
'username' => 'admin1',
thewirelessguy / getAppIcon.swift
Created Mar 14, 2017
Use current iOS app icon with UIImageView in Swift 3
View getAppIcon.swift
// GetAppIcon.swift
// Get the AppIcon from Assets and return it as a UIImage
// Created by Stephen Mullen
import UIKit
func getAppIcon() -> UIImage {
thewirelessguy / function.php
Last active Aug 24, 2018
How to use Google's Organisation Logo markup with WordPress Theme Logo
View function.php
function mytheme_setup() {
add_action('after_setup_theme', 'mytheme_setup');
thewirelessguy / app-icon-uiimageview.swift
Last active Apr 12, 2017
Use current iOS app icon with UIImageView in Swift 2 (Swift 3 example:
View app-icon-uiimageview.swift
let primaryIconsDictionary = NSBundle.mainBundle().infoDictionary?["CFBundleIcons"]?["CFBundlePrimaryIcon"] as? NSDictionary
let iconFiles = primaryIconsDictionary!["CFBundleIconFiles"] as! NSArray
let lastIcon = iconFiles.lastObject as! NSString //last seems to be largest, use first for smallest
let theIcon = UIImage(named: lastIcon as String)
let iconImageView = UIImageView(image: theIcon)
thewirelessguy / AndroidManifest.xml
Last active Aug 8, 2018
Setting up styles.xml and values-v21/styles.xml to use Material Design with AppCompat. Rename styles21.xml as styles.xml and place in your res/values-v21 folder (you may need to create a values-v21 folder if you don't already have one).
View AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android=""
package="" >
android:theme="@style/AppTheme" >
thewirelessguy / Detect the last post in the WordPress loop
Last active Mar 20, 2020
Detect the last post in the WordPress loop
View Detect the last post in the WordPress loop
<?php if (($wp_query->current_post +1) == ($wp_query->post_count)) {
echo 'This is the last post';
} ?>
<?php if (($wp_query->current_post +1) != ($wp_query->post_count)) {
echo 'This is the not the last post';
} ?>
thewirelessguy / functions.php
Created Aug 9, 2013
Removing Custom Post Types in WordPress. This example removes the Orbit Custom Post Type from the Cornerstone WordPress starter theme. You would include it the functions.php of your child theme.
View functions.php
add_action( 'after_setup_theme','remove_cornerstone_features', 100 );
function remove_cornerstone_features() {
remove_action( 'init', 'Orbit');
You can’t perform that action at this time.