Skip to content

Instantly share code, notes, and snippets.

@jeffquach
jeffquach / Shopify verify theme support
Last active January 3, 2023 00:30
Sample code: https://shopify.dev/apps/online-store/verify-support contains bugs. The code should be checking `templateJSONFiles.length > 0` but doesn't. The gist also doesn't not use Shopify's node library and HTTP requests are made to Shopify's REST API using node-fetch, but any HTTP library can be used instead
const fetch = require('node-fetch');
try {
// Specify the name of the template the app will integrate with
const APP_BLOCK_TEMPLATES = ['product', 'collection'];
const getOptions = { method: 'GET', headers: { 'X-Shopify-Access-Token': accessToken } };
// Get published theme
const themeResponse = await fetch(`https://${shop}/admin/api/${API_VERSION}/themes.json`, getOptions);
this.checkError(themeResponse, 'ThemeFetchFailure');
#include "FacebookShare.h"
FacebookShare* FacebookShare::create()
{
FacebookShare* fb = new (std::nothrow) FacebookShare();
if(fb && fb->init()){
fb->autorelease();
PluginFacebook::setListener(fb);
PluginFacebook::init();
@jeffquach
jeffquach / SocialFeatures.cs
Last active October 30, 2016 22:33
Final script for integrating Google Play Games and Game Center into a Unity game
using UnityEngine;
using UnityEngine.SocialPlatforms;
#if UNITY_ANDROID
using GooglePlayGames;
using GooglePlayGames.BasicApi;
#endif
public class SocialFeatures : MonoBehaviour {
void Start () {