Skip to content

Instantly share code, notes, and snippets.

View scottbartell's full-sized avatar
👋

Scott Bartell scottbartell

👋
View GitHub Profile
@kreo
kreo / css-ios-pwa-viewport.css
Created January 28, 2022 16:18 — forked from cvan/css-ios-pwa-viewport.css
CSS for env(safe-area-inset-top) for iOS "Add to Homescreen" / PWA; standalone styles
@supports (padding-top: constant(safe-area-inset-top)) {
body {
padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
}
@media (display-mode: fullscreen) {
body {
padding: 0;
}
-- Author: Krisjan Oldekamp
-- https://stacktonic.com/article/enrich-a-single-customer-view-with-google-analytics-4-big-query-data
declare lookback_window int64 default 365; -- how many days to lookback into the ga4 dataset to calculate profiles
-- udf: channel grouping (you could put this in a permanent function)
-- also see https://stacktonic.com/article/google-analytics-4-and-big-query-create-custom-channel-groupings-in-a-reusable-sql-function
create temporary function channel_grouping(tsource string, medium string, campaign string) as (
case
when (tsource = '(direct)' or tsource is null)
@krisjan-oldekamp
krisjan-oldekamp / google_analytics_bigquery_user_mapping_table_customer.sql
Last active February 26, 2024 08:52
How to create a user mapping table (or Identity Graph) based on all the available user identifiers in the Google Analytics 4 BigQuery exports (like device-IDs or customer-IDs). Full article on stacktonic.com
-- Author: Krisjan Oldekamp
-- https://stacktonic.com/article/create-a-user-mapping-table-based-on-the-google-analytics-4-big-query-dataset
declare lookback_window int64 default 90; -- how many days to lookback into the dataset to search for ids (compared to today)
-- udf: deduplicate array of struct
create temp function dedup(arr any type) as ((
select
array_agg(t)
from (
@tedgonzalez
tedgonzalez / AppStoreConnectRoles.md
Last active January 6, 2024 15:59
Ever since the Apple developer portal and App Store Connect merged, I got confused with the summary. I like knowing the diff between App Store Connect roles. Here's a detailed list of what each role can do:

App Store Connect Roles

Developer Developer with certificates AppManager AppManager with certificates Admin Account Holder
App Features
Upload Builds
Edit App Store Details (Read)
Create Apps and Submit Versions
@colinfwren
colinfwren / iOSExpoClientSetup.js
Created August 12, 2020 21:06
Launching the Expo Client on iOS
import {remote} from "webdriverio";
const capabilities = {
platformName: 'iOS',
platformVersion: '13.6',
deviceName: 'DEVICE_NAME', // Change this to the device you want to run
automationName: 'XCUITest',
bundleId: 'com.apple.mobilesafari',
autoAcceptAlerts: true,
};
@cvan
cvan / css-ios-pwa-viewport.css
Created April 3, 2020 22:14
CSS for env(safe-area-inset-top) for iOS "Add to Homescreen" / PWA; standalone styles
@supports (padding-top: constant(safe-area-inset-top)) {
body {
padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
}
@media (display-mode: fullscreen) {
body {
padding: 0;
}
@drovani
drovani / auth0-rule-shopify-multipass.js
Last active January 30, 2024 19:52
Auth0 Rule to Generate a Multipass token and redirect the user back to the Shopify store
function (user, context, callback) {
if (context.clientMetadata && context.clientMetadata.shopify_domain && context.clientMetadata.shopify_multipass_secret)
{
const RULE_NAME = 'shopify-multipasstoken';
const CLIENTNAME = context.clientName;
console.log(`${RULE_NAME} started by ${CLIENTNAME}`);
const now = (new Date()).toISOString();
let shopifyToken = {
email: user.email,
require('expect-puppeteer');
const isCI = require('is-ci');
const path = require('path');
const { mkdirp, writeFile } = require('fs-extra');
const screenshotsPath = path.resolve(__dirname, '../reports/screenshots');
const toFilename = s => s.replace(/[^a-z0-9.-]+/gi, '_');
@LeZuse
LeZuse / stats_logger.rb
Last active June 21, 2021 13:53
Puma plugin for stats logging on Heroku
Puma::Plugin.create do
def production?
ENV.fetch('RACK_ENV', 'development') == 'production'
end
def log(msg)
if production?
Rails.logger.info msg
else
puts msg
@zdennis
zdennis / browser_logging.rb
Created June 26, 2018 19:11
Chromedriver browser logging for Capybara
# browser_logging.rb will print out the browser log from Chrome
# when running specs with "js: true". This is so we can easily debug
# issues where there are JS errors or other console warnings/error(s), etc.
#
# Output file is: Rails.root/log/browser.log
#
# Note: Nothing will be printed out for non-JS examples.
RSpec.configure do |config|
browser_log = File.new(Rails.root.join("log/browser.log").to_s, "w")
browser_log.sync = true