Skip to content

Instantly share code, notes, and snippets.

@stephsharp
stephsharp / README.md
Last active October 24, 2022 03:00
Sample code for Stack Overflow question about using a single colour swatch in a Shopify theme (http://stackoverflow.com/questions/18978460/color-swatch-variant-dropdown-list-for-shopify-products)

This is for a Stack Overflow question about using colour swatches in a Shopify theme. It modifies the code provided in this tutorial on the Shopify wiki to only display one swatch that changes color depending on the selected option.

Related links:

@stephsharp
stephsharp / README.md
Last active August 19, 2021 14:50
Sample code for Stack Overflow question about using radio buttons for Shopify variants (http://stackoverflow.com/questions/19085276/shopify-variants)
@stephsharp
stephsharp / README.md
Last active October 22, 2020 00:36
Stack Overflow user profile Dashing widget

Badge Overflow

An exceptionally handsome way to track your Stack Overflow badges.
Note: Badge Overflow now works with all Stack Exchange sites.

Created by Adam & Stephanie Sharp.

User Profile widget

A Dashing widget that

@stephsharp
stephsharp / README.md
Last active February 8, 2019 12:23
This code is for a Stack Overflow question about displaying related products in a Shopify theme using product tags.
@stephsharp
stephsharp / UIImage+Tint.h
Last active August 29, 2017 19:32
UIImage+Tint
//
// UIImage+Tint.h
// Created by Stephanie Sharp on 5/03/2014.
//
#import <UIKit/UIKit.h>
@interface UIImage (Tint)
- (UIImage *)translucentImageWithAlpha:(CGFloat)alpha;
@stephsharp
stephsharp / README.md
Last active December 25, 2015 09:59
Sample code for Stack Overflow question about using colour swatches in a Shopify theme (http://stackoverflow.com/questions/19227823/how-can-i-create-smarter-swatches-for-a-shopify-theme)
@stephsharp
stephsharp / ViewController.h
Last active December 21, 2015 10:09
Insert an object into a property of type NSArray by creating a mutable copy.
@property (nonatomic, retain) NSArray * pins;
# Mac OS X
*.DS_Store
# Xcode
*.pbxuser
*.mode1v3
*.mode2v3
*.perspectivev3
*.xcuserstate
project.xcworkspace/
@stephsharp
stephsharp / LoadingView.h
Created July 28, 2013 23:40
Simple iOS loading view
//
// LoadingView.h
// Created by Stephanie Sharp on 26/05/13.
//
// http://www.sitepoint.com/all-purpose-loading-view-for-ios/
// http://www.cocoawithlove.com/2009/04/showing-message-over-iphone-keyboard.html
#import <UIKit/UIKit.h>
@interface LoadingView : UIView
@stephsharp
stephsharp / ReadFromPList.m
Last active December 18, 2015 11:58
Snippet to read data from a property list
// Helpful tutorial:
// http://www.theappcodeblog.com/2011/05/30/property-list-tutorial-using-plist-to-store-user-data/
// Get property list from main bundle
NSString * plistPath = [[NSBundle mainBundle] pathForResource:@"PListName" ofType:@"plist"];
// Read property list into memory as an NSData object
NSData * plistXML = [[NSFileManager defaultManager] contentsAtPath:plistPath];
NSString * errorDesc = nil;
NSPropertyListFormat format;