Skip to content

Instantly share code, notes, and snippets.

@dreadjr
dreadjr / iOS_sysdiagnose.md
Created October 27, 2022 18:23 — forked from danieleggert/iOS_sysdiagnose.md
How to trigger a sysdiagnose on iOS

How To sysdiagnose on iOS:

  1. Hold volume up + volume down + power for 250 milliseconds.
  2. Wait (up to 5 minutes)
  3. Settings.app > Privacy > Analytics > Analytics Data
  4. Select the "sysdiagnose_" file and share via AirDrop to a Mac.
@dreadjr
dreadjr / Firebase Local Storage IndexedDb Dump.js
Last active December 8, 2022 01:19 — forked from Matt-Jensen/Firebase Local Storage IndexedDb Dump.js
Access your Firebase Auth Token by dumping your IndexedDB session
function getToken() {
return new Promise((resolve, reject) => {
let db;
let request = indexedDB.open("firebaseLocalStorageDb");
request.onerror = function (event) {
console.error(event);
reject(event);
};
@dreadjr
dreadjr / delete_artifacts.js
Created September 17, 2021 07:17 — forked from krasimir/delete_artifacts.js
Deleting artifacts in GCP's Cloud Storage (ignores latest and leaves at least two versions)
const spawn = require("child_process").spawn;
const KEEP_AT_LEAST = 2;
const CONTAINER_REGISTRIES = [
"gcr.io/<your project name>",
"eu.gcr.io/<your project name>/gcf/europe-west3"
];
async function go(registry) {
console.log(`> ${registry}`);
@dreadjr
dreadjr / FairPlayer.swift
Created July 23, 2021 22:02 — forked from fousa/FairPlayer.swift
Integrate HLS with FairPlay.
class FairPlayer: AVPlayer {
private let queue = DispatchQueue(label: "com.icapps.fairplay.queue")
func play(asset: AVURLAsset) {
// Set the resource loader delegate to this class. The `resourceLoader`'s delegate will be
// triggered when FairPlay handling is required.
asset.resourceLoader.setDelegate(self, queue: queue)
// Load the asset in the player.
@dreadjr
dreadjr / Query
Created March 29, 2021 19:49 — forked from lukecav/Query
MySQL script to get all WooCommerce orders including metadata
select
p.ID as order_id,
p.post_date,
max( CASE WHEN pm.meta_key = '_billing_email' and p.ID = pm.post_id THEN pm.meta_value END ) as billing_email,
max( CASE WHEN pm.meta_key = '_billing_first_name' and p.ID = pm.post_id THEN pm.meta_value END ) as _billing_first_name,
max( CASE WHEN pm.meta_key = '_billing_last_name' and p.ID = pm.post_id THEN pm.meta_value END ) as _billing_last_name,
max( CASE WHEN pm.meta_key = '_billing_address_1' and p.ID = pm.post_id THEN pm.meta_value END ) as _billing_address_1,
max( CASE WHEN pm.meta_key = '_billing_address_2' and p.ID = pm.post_id THEN pm.meta_value END ) as _billing_address_2,
max( CASE WHEN pm.meta_key = '_billing_city' and p.ID = pm.post_id THEN pm.meta_value END ) as _billing_city,
max( CASE WHEN pm.meta_key = '_billing_state' and p.ID = pm.post_id THEN pm.meta_value END ) as _billing_state,
@dreadjr
dreadjr / svg-convert.sh
Created July 13, 2020 17:20 — forked from zolthan/svg-convert.sh
Convert SVG to PNG @2x @3x
#!/bin/bash
# I made this script to convert SVG icons for an iOS app into PNG.
# The script will create icons in 3 sizes for different screen DPIs.
find . -type f -name "*.svg" | while read f
do
echo '---'
FILENAME="${f%.*}"
echo $FILENAME
@dreadjr
dreadjr / adding_new_webhook_topics.php
Created July 7, 2020 18:07 — forked from jessepearson/adding_new_webhook_topics.php
How to add a new custom Webhook topic in WooCommerce, with example of order filtering.
<?php // do not copy this line
/**
* add_new_topic_hooks will add a new webhook topic hook.
* @param array $topic_hooks Esxisting topic hooks.
*/
function add_new_topic_hooks( $topic_hooks ) {
// Array that has the topic as resource.event with arrays of actions that call that topic.
@dreadjr
dreadjr / adding_new_webhook_topics.php
Created July 7, 2020 17:27 — forked from berkedel/adding_new_webhook_topics.php
How to add a new custom Webhook topic in WooCommerce, with example of order filtering.
<?php // do not copy this line
/**
* add_new_topic_hooks will add a new webhook topic hook.
* @param array $topic_hooks Esxisting topic hooks.
*/
function add_new_topic_hooks( $topic_hooks ) {
// Array that has the topic as resource.event with arrays of actions that call that topic.
@dreadjr
dreadjr / analyse_watchers.js
Created March 25, 2019 20:21 — forked from DTFagus/analyse_watchers.js
Bookmarklet to analyse angular watchers
javascript: (function() {
var root = $(document.getElementsByTagName('html'));
var watchers = [];
var attributes = [];
var attributes_with_values = [];
var elements = [];
var elements_per_attr = [];
var scopes = [];