Skip to content

Instantly share code, notes, and snippets.

View rwheadon's full-sized avatar

Rich Wheadon rwheadon

View GitHub Profile
@rwheadon
rwheadon / dynamic_object_updates.es6
Last active October 11, 2023 03:46
Dynamic update (in-place) of a JSObject with dynamic path via array.
const testOb = {
slot1: {
cubby1: {
envelope1: {
page1: "Hello World",
page2: "Living large",
},
envelope2: {
page1: "No Escape",
page2: "Supercharger",
@rwheadon
rwheadon / rvm_install_rails2_gem_wrapper_erroring.txt
Created March 31, 2019 00:59
rvm error generating gem wrappers
[Sat Mar 30 20:38:15]mbpv14:camp-registration devuser$ rvm get master
Downloading https://get.rvm.io
No GPG software exists to validate rvm-installer, skipping.
Downloading https://github.com/rvm/rvm/archive/master.tar.gz
Upgrading the RVM installation in /Users/devuser/.rvm/
RVM PATH line found in /Users/devuser/.mkshrc /Users/devuser/.profile /Users/devuser/.bashrc /Users/devuser/.zshrc.
RVM sourcing line found in /Users/devuser/.profile /Users/devuser/.bash_profile /Users/devuser/.zlogin.
Upgrade of RVM in /Users/devuser/.rvm/ is complete.
Thanks for installing RVM 🙏
@rwheadon
rwheadon / listBehavior
Created August 9, 2016 14:07
List Behavior that seems a bit non intuitive
/*
* in the simple test below I am a bit uncomfortable with how
* the private property pathSet is updated w/o a setter
* is this exploiting a Java bug or is it intentional and expected behavior
* that will be supported for a long time?
*/
public class SimpleClass {
private List<String> pathSet;
public List<String> getPathSet() {
@rwheadon
rwheadon / resttest.java
Created July 26, 2016 22:49
Getting machine owner's email address
public static void main(String[] args) throws IOException {
for (CatalogResource machine : machines) {
example.viewDetails(machine);
List<CatalogPrincipal> owners = machine.getOwners();
for( CatalogPrincipal owner : owners ){
String ownerEmail = example.getUserEmail(owner.getRef());
System.out.println("OWNER: " + owner.getValue()
+ " (" + owner.getType()
+ ") : Username" + owner.getRef()