Skip to content

Instantly share code, notes, and snippets.

View stevewithington's full-sized avatar
⛑️
solving problems

steve withington stevewithington

⛑️
solving problems
View GitHub Profile
@BretFisher
BretFisher / docker-for-mac.md
Last active May 23, 2024 22:25
Getting a Shell in the Docker Desktop Mac VM

2021 Update: Easiest option is Justin's repo and image

Just run this from your Mac terminal and it'll drop you in a container with full permissions on the Docker VM. This also works for Docker for Windows for getting in Moby Linux VM (doesn't work for Windows Containers).

docker run -it --rm --privileged --pid=host justincormack/nsenter1

more info: https://github.com/justincormack/nsenter1


@stevewithington
stevewithington / mura-js-form.js
Last active April 27, 2018 19:09
Mura CMS: How to manipulate the DOM of a form in Mura CMS v7+
<script>
Mura.DisplayObject.Form.reopen({
onAfterRender: function() {
//this.context.targetEl is a pointer to the dom element that contains the rendered Mura form.
var container = Mura(this.context.targetEl);
console.log(this.context.targetEl);
}
#!/bin/bash -e
ln -s /usr/lib/x86_64-linux-gnu/amdgpu-pro .
ln -s /etc/OpenCL .
tar -czvf libs.tar.gz amdgpu-pro/*
tar -czvf conf.tar.gz OpenCL/*
cat > .dockerignore << EOF
OpenCL
@ebidel
ebidel / fancy-tabs-demo.html
Last active March 8, 2024 23:08
Fancy tabs web component - shadow dom v1, custom elements v1, full a11y
<script src="https://unpkg.com/@webcomponents/custom-elements"></script>
<style>
body {
margin: 0;
}
/* Style the element from the outside */
/*
fancy-tabs {
margin-bottom: 32px;
@erichrobinson
erichrobinson / README.md
Last active February 24, 2024 08:32
SwitchResX Configuration

#SwitchResX Settings for LG 21:9 UltraWide

SwitchResX is a utility that allows users to override the default resolution settings in OSX. For more information, including download links, vist http://www.madrau.com/ .

##Disabling System Integrity Protection (SIP)

If you are running OSX 10.11 or higher, SIP must be disabled. To disable SIP do the following:

  • Boot into the recovery partition by pressing CMD + R when starting up your Mac.
  • Once in recovery mode, open a terminal window.
  • Type the command csrutil disable
@christierney402
christierney402 / S3Wrapper.cfc
Last active February 9, 2019 07:30
Amazon Web Services (AWS) S3 Wrapper for ColdFusion
/**
* Amazon S3 REST Wrapper
* Version Date: 2015-09-03
*
* Copyright 2015 CF Webtools | cfwebtools.com
*
* Licensed 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
*
@stevewithington
stevewithington / mura-json-api.cfm
Last active December 14, 2020 18:11
Mura CMS: JSON API Tests & Examples
<!---
Author: Stephen J. Withington, Jr.
Notes: Place this under a temp directory within your Mura CMS root to test.
For example: http://yourdomain.com/temp/json-test.cfm
--->
<cfscript>
param name="form.endpoint" default="content/new";
param name="form.method" default="GET";
param name="form.context" default="";
param name='session.siteid' default='default';
@stevewithington
stevewithington / muraSendEmail.cfm
Last active February 20, 2024 14:33
Mura CMS : How to send an email to the person who submitted the form
<!--- Drop this in your Site or Theme eventHandler.cfc --->
<cffunction name="onAfterFormSubmitSave">
<cfargument name="$">
<cfset var msg = '' />
<cfset var formBean = $.event().getValue('formBean') />
<cfset var formResultBean = $.event().getValue('formDataBean') />
<cfset var formResultStruct = $.event().getValue('formDataBean').getValue('formResult') />
<cfif formBean.getTitle() eq 'Your Desired Form Title'>
<cfsavecontent variable="msg">
@stevewithington
stevewithington / muraDisableFrontEndTools.cfm
Last active April 27, 2018 19:15
Mura CMS : How to disable front end tools and front end editing for public facing sites. This would then allow you to completely delete/remove the 'admin' directory from the production server, and only host it on a dev/staging server that's hosted behind a firewall, assuming each instance is pointing to the same database. NOTE: Do NOT delete you…
<!---
1) Drop this method in your /config/cfapplication.cfm and modify it as you wish.
For example, maybe you only want to allow front end tools if editing the site behind your firewall
--->
<cfscript>
public boolean function getEnableFrontEndTools() {
return getPageContext().getRequest().getServerName() == 'someURLAccessibleOnlyBehindYourFirewall.com';
}
</cfscript>
@stevewithington
stevewithington / mura404.cfm
Created July 3, 2014 15:38
Mura CMS: By default, Mura will not throw a 404 on missing ".cfm" files. This is intended behaviour so that you can integrate existing applications with Mura. If you wish to override this behaviour, use the method in this Gist.
<cfscript>
// drop this into your SITE or THEME eventHandler.cfc to trigger a 404 on missing .cfm files
public any function onSiteRequestStart($) {
request.uri = GetPageContext().GetRequest().GetRequestURI();
request.template = Right(request.uri, 1) != '/' ? ListLast(request.uri, '/') : '';
if ( Len(request.template) && !FileExists(ExpandPath(request.template)) ) {
request.currentfilenameadjusted = request.template;
}
}
</cfscript>