Skip to content

Instantly share code, notes, and snippets.

Ron Waldon jokeyrhyme

View GitHub Profile
@jokeyrhyme
jokeyrhyme / Highest Of Each Species.lua
Last active Nov 13, 2018
WoW: Rematch addon: Scripts
View Highest Of Each Species.lua
if unique then
return true
end
same = {}
for p in AllPetIDs() do
s, _, l, x = C_PetJournal.GetPetInfoByPetID(p)
if s == speciesID then
if l > level and x >= xp then
table.insert(same, 1, p)
@jokeyrhyme
jokeyrhyme / Update.psm1
Last active May 14, 2017
experiments in keeping my Windows environment sync'ed and updated across multiple boxes
View Update.psm1
# as Administrator
Set-ExecutionPolicy AllSigned
Install-Module PackageManagement -AllowClobber -Force
Install-PackageProvider chocolatey
Install-Module -Name ChocolateyGet
Install-Package -Name golang
Install-Package -Name nodejs
@jokeyrhyme
jokeyrhyme / detect-ionic-deploy.js
Last active Nov 11, 2016
detect-ionic-deploy.js
View detect-ionic-deploy.js
// accurate _after_ Cordova's "deviceready" event
function isIonicDeployPath (
appId /* : string */,
global /* : Window | Global */
) /* : Promise<boolean> */ {
'use strict'
if (!global.IonicDeploy || !global.IonicDeploy.info) {
return Promise.resolve(false)
}
@jokeyrhyme
jokeyrhyme / atom-language-babel-flowtype-comments-issue.js
Created Oct 11, 2016
sample code to trigger a weird colouring issue with the language-babel plugin for Atom
View atom-language-babel-flowtype-comments-issue.js
'use strict'
function looksFine () {}
function looksFineWithArgs (
first /* : string */,
second /* : number */
) /* : boolean */ {
const statementsLookGood = true
return false
@jokeyrhyme
jokeyrhyme / forty-five-serverless-handlers.js
Last active Oct 10, 2016
stress-test script to add 45 AWS APIG routes and 500 AWS Lambda functions via Serverless: https://serverless.com/
View forty-five-serverless-handlers.js
'use strict'
const fs = require('fs')
const path = require('path')
const padStart = require('lodash.padstart')
const yaml = require('js-yaml')
const PROJECT_PATH = path.join(__dirname, '..')
const SERVERLESS_PATH = path.join(PROJECT_PATH, 'serverless.yml')
@jokeyrhyme
jokeyrhyme / load-script-once.js
Last active Sep 7, 2016
experimentation with a script loader that de-duplicates requests for scripts
View load-script-once.js
/**
load this prior to to all other scripts on the page,
then it will be able to monitor script loading properly
requires: Promise, MutationObserver, querySelectorAll, Map, Set, const, let
*/
;(() => {
'use strict'
@jokeyrhyme
jokeyrhyme / macos-keychain-research.m
Last active Sep 6, 2016
incomplete research for a way to delete private keys from the macOS Keychain
View macos-keychain-research.m
//
// main.m
// macos-keychain-delete-private-key
//
// Created by Ron Waldon on 2016-08-30.
// Copyright © 2016 Ron Waldon. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <Security/Security.h>
@jokeyrhyme
jokeyrhyme / docker-npm.js
Created Aug 30, 2016
execute `npm` within a Docker container, within the host's working directory
View docker-npm.js
'use strict'
// ideal for use with AWS Lambda and native Node.js modules
// requires Docker: https://docs.docker.com/engine/installation/
/*
Usage:
node docker-npm.js install
node docker-npm.js rebuild
@jokeyrhyme
jokeyrhyme / extract-heredoc.php
Created Aug 11, 2016
quick and bad script to migrate PHP heredoc out into a separate file
View extract-heredoc.php
<?php
/*
usage:
php extract-heredoc.php my-code-file.php
creates my-code-file.heredoc.php
assumes input file is a single <?php code block
@jokeyrhyme
jokeyrhyme / index.html
Last active Nov 10, 2016
ionic-deploy-plugin useCheckResponse
View index.html
<!DOCTYPE html>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
You can’t perform that action at this time.