Skip to content

Instantly share code, notes, and snippets.

View edm00se's full-sized avatar

Eric McCormick edm00se

View GitHub Profile
@edm00se
edm00se / Error.xsp.xml
Last active September 24, 2015 14:12
Custom runtime error XPage with Google Code Prettify.
<?xml version="1.0" encoding="UTF-8"?>
<xp:view
xmlns:xp="http://www.ibm.com/xsp/core"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.ibm.com/xsp/core xsdxp://localhost/xsp~core.xsd"
pageTitle="${javascript:database.getTitle() + ' | Error'}">
<style
type="text/css"><![CDATA[
body {
background-color: lightblue;
@edm00se
edm00se / vanillaXhrGet.js
Last active June 15, 2017 19:43
Vanilla JS function to perform a GET XMLHttpRequest against a passed URL and execute the callback function with the returned results. On error, puts an error message to the console and returns null to the callback.
/*
* Note: these days you should probably just use fetch:
* https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API
*
* A convenience function, to handle the vanilla js xhr
* request.
*
* @param {string} url - the URI against which to make the request
* @param callback - the callback function, which returns an obj,
* with two params, err (which is null of not error), and
@edm00se
edm00se / ReadMe.md
Last active February 7, 2016 18:26
Sample utility library

Utility Library Example

Adding a utility library is a great and convenient way to provide convenince functions for use at a global or near-global level.

Adding

Hooking a utility SSJS library works about the same as any Code > Script Library asset in XPages. You can add it via a Theme, my personal recommendation as it makes keeping things tidy quite easy, or by adding it as an xp:resource (resources at the root XPage or Custom Control via the pretty pane). The down side of relying on adding it to a Custom Control is that it will only be available in an SSJS code block if the Custom Control in question has been loaded as part of the user's component tree (the built page); this also leads to potential duplication if the developer starts loading it on lots of Custom Controls.

Via Theme

@edm00se
edm00se / About.md
Last active May 31, 2017 03:11
An open letter to CBS & Paramount, regarding the release of their fan film guidelines.

An Open Letter to CBS & Paramount

CBS & Paramount recently released and announced the new guidelines for fan films (productions). That they are fairly limited in scope for those who seek to create as part of their passion is pretty obvious. I seek anyone who is so empassioned to provide the well reasoned and respectful feedback that Star Trek deserves.

In Short

To reach for the stars, we need to reach a little higher.

@edm00se
edm00se / About.md
Last active August 29, 2019 12:37
Progress bar indicator (jQuery).
@edm00se
edm00se / NotesForOlderMacs.md
Last active May 28, 2021 15:01
Mac Setup for Homebrew, Casks, and Required Xcode CLI Tools

Older Macs

You probably need to:

  • install XCode CLI Tools (which can be difficult on older versions)
  • update OpenSSL
  • upgrade git

Install XCode CLI Tools

@edm00se
edm00se / Example.md
Last active January 19, 2019 03:15
How to Embed "Spoiler" Expandable Code Block in GitHub MD (Issues, etc.)
stuff with *mark* **down**

formatted heading with a

<omg>amazing code!</omg>
@edm00se
edm00se / _darkMinima.scss
Created May 8, 2018 17:20
a Dark Minima "theme" on the cheap
$brand-color: #d07922;
$background-color: #222426; /* a dark, off-black for the bg */
$text-color: #e6e6e6; /* an off-white for the text */
$grey-color-light: #565656; /* for the border-top separators */
$grey-color-dark: #adadad; /* such as the site title in the header, visited */
@edm00se
edm00se / nanorc.sh
Created January 19, 2019 03:12
nano syntax highlighting (macOS)
# install
brew install nano
# configure
echo 'include "/usr/local/Cellar/nano/3.2/share/nano/*.nanorc"' > ~/.nanorc
# restart your shell
@edm00se
edm00se / reset_https_npm.sh
Last active June 27, 2019 20:03
for re-setting https when npm install is dumb and removes https
# for re-setting https when npm install is dumb and removes https
# explainshell: https://www.explainshell.com/explain?cmd=sed+-i+-e+%27s%2Fhttp%3A%5C%2F%5C%2F%2Fhttps%3A%5C%2F%5C%2F%2Fg%27+package-lock.json
sed -i -e 's/http:\/\//https:\/\//g' package-lock.json