Skip to content

Instantly share code, notes, and snippets.

View jessgusclark's full-sized avatar

Jesse Clark jessgusclark

View GitHub Profile
@jessgusclark
jessgusclark / getConfig.js
Last active May 19, 2020 13:22
Get the contract addresses needed for the RNS Manager after running the RNS suite migration
// Procedrual script that gets the contract addresses from the build
// folder after migration. This file can be used inside of the RNS
// Manager React application to use the local RKS network.
// The code isn't pretty, but it works.
//
// TO RUN:
// Set the two variables below, and then in the console, run:
// node getConfig.js
//
// the output is a json script that can be copied and pasted into the
@jessgusclark
jessgusclark / pipelines-algolia-snippet.yml
Created December 17, 2019 16:09
Algolia Pipelines Step
- step:
name: Send content to Algolia
caches:
- bundler
script:
# install dependencies
- bundle install --path vendor/bundle
# Run the Algolia Jekyll plugin
- bundle exec jekyll algolia
@jessgusclark
jessgusclark / bitbucket-pipelines.yml
Last active June 5, 2019 13:30
React to Production Pipelines file
#bitbucket-pipelines.yml
image: node:10.15.3
pipelines:
default:
- step:
name: Build React Project
script:
- npm install
- npm run-script build
<xsl:template match="component[@class='widgetAnywhere']">
<xsl:variable name="path" select="concat($ou:root, $ou:site, path)" />
<xsl:choose>
<!-- Show an error if the file can not be found on staging -->
<xsl:when test="not(doc-available(replace($path, '.htm', '.pcf')))">
<div class="panel">
<h2 class="normal-size">Widget Anywhere ERROR</h2>
<p>The include file could not be found on staging.</p>
<code><xsl:value-of select="path" /></code>
@jessgusclark
jessgusclark / widget-anywhere-source.xml
Created March 1, 2019 10:23
Widget Anywhere Component XML
<component class="widgetAnywhere">
<path></path>
</component>
@jessgusclark
jessgusclark / gist-embed.rb
Created October 24, 2018 20:28
A simple liquid template for embedding GitHub gists on a Jekyll page
module Jekyll
class EmbedGist < Liquid::Tag
def initialize(tag_name, url, tokens)
super
# remove spaces from string:
@url = url.gsub!(/\s+/, '')
end
def render(context)
@jessgusclark
jessgusclark / hello-world.rb
Last active October 24, 2018 20:01
Hello World Jekyll Plugin
module Jekyll
class HelloWorld < Liquid::Tag
def initialize(tag_name, text, tokens)
super
@text = text
end
def render(context)
"Hello World, #{@text}!"
<xsl:for-each select="document('https://tacos.tacos/path.to/my-feed-rss')/feed/entry">
<xsl:sort select="published" />
<h2><xsl:value-of select="title" /></h2>
</xsl:for-each>
@jessgusclark
jessgusclark / file1.pcf.html
Last active March 20, 2018 20:30
PCF / XSL example. First file's extenstion should be .pcf, .html is for code hinting. Change line 2 to correct path.
<?xml version="1.0" encoding="utf-8" ?>
<?pcf-stylesheet path="/jesse/ocn/xiaoman/test1.xsl" extension="html"?>
<!DOCTYPE document SYSTEM "http://commons.omniupdate.com/dtd/standard.dtd">
<document xmlns:ouc="http://omniupdate.com/XSL/Variables">
<ouc:properties label="config">
<parameter name="pagetype" type="select" group="Everyone" prompt="Page Type" alt="Please choose appropriate page type.">
<option value="article" selected="false">Article</option>
<option value="content" selected="false">Content</option>
<option value="onecolumn" selected="true">One Column</option>
@jessgusclark
jessgusclark / HelloWorld.sol.js
Last active December 2, 2017 20:28
Jesse's HelloWorld in Solidity
pragma solidity ^0.4.0;
contract HelloWorld {
uint private magicNumber;
address private magicPerson;
// constructor
function HelloWorld() public {
log0("HelloWorld constructor started");