Skip to content

Instantly share code, notes, and snippets.

View seanonthenet's full-sized avatar
🎯
Focusing

Sean Park-Ross seanonthenet

🎯
Focusing
View GitHub Profile
@seanonthenet
seanonthenet / CRYPTOCURRENCY.ts
Created May 17, 2022 12:47
CRYPTOCURRENCY LIST WIP
type Currency = {
name: string;
code: string;
symbol: string;
unicode: string;
};
export const CRYPTOCURRENCIES: Currency[] = [
{ name: 'Algorand', code: 'ALGO', symbol: '\u023A', unicode: 'Ⱥ' },
{ name: 'Augur', code: 'REP', symbol: '', unicode: 'Ɍ' },
@seanonthenet
seanonthenet / const.ts
Created March 30, 2022 13:20
Shopify Admin API Zeus GraphQL Typescript Types const.ts
/* eslint-disable */
export const AllTypesProps: Record<string, any> = {
ARN: 'String',
AppInstallation: {
allSubscriptions: {
first: {
type: 'Int',
array: false,
arrayRequired: false,
@seanonthenet
seanonthenet / index.ts
Created March 30, 2022 13:15
Shopify Admin API Zeus GraphQL Typescript Types index.ts
This file has been truncated, but you can view the full file.
/* eslint-disable */
import { AllTypesProps, ReturnTypes } from './const';
type ZEUS_INTERFACES =
| GraphQLTypes['AppPurchase']
| GraphQLTypes['CalculatedDiscountApplication']
| GraphQLTypes['CommentEventSubject']
| GraphQLTypes['CustomerMoment']
| GraphQLTypes['DiscountApplication']
# Git Aliases
alias g='git'
compdef g=git
## Status
alias gs='git status'
compdef _git gst=git-status
alias gss='git status -s'
@seanonthenet
seanonthenet / asyncforeach.js
Created April 19, 2019 03:45
Async forEach Pattern
const waitFor = (ms) => new Promise(r => setTimeout(r, ms));
async function asyncForEach(array, callback) {
for (let index = 0; index < array.length; index++) {
await callback(array[index], index, array);
}
}
const start = async () => {
await asyncForEach([1, 2, 3, 4, 5], async (num) => {
@seanonthenet
seanonthenet / protocolDelegate.swift
Last active December 1, 2017 16:19
Swift Protocol Delegate Pattern
// protocol declaration
protocol myDelegate {
func myFunction()
}
// Receiver / Performer / Intern
class Receiver: SomeClass, myDelegate {
// instantiate instance of sender class before this
caller.delegateInstance = self
/**
* Display recommended plugin notice only on the plugins page, can be dismissed
*/
add_action('admin_notices', 'nikkon_recommended_plugin_notice');
function nikkon_recommended_plugin_notice() {
global $pagenow;
global $current_user;
$user_id = $current_user->ID;