Skip to content

Instantly share code, notes, and snippets.

@l3aconator
l3aconator / greenhouse.css
Last active June 11, 2019 02:19
greenhouse.css
#wrapper #logo {
display: none !important;
}
p {
font-family: 'futura-pt', 'sans-serif';
}
.app-title,
#board_title {
@l3aconator
l3aconator / createBulkFileSimple.js
Created December 13, 2018 17:25
Node script to write filename and extension to filesystem based on an array of filenames. Helpful for creating a list of container files to copy and paste content into. My use case was taking an array of svg icon names to then have content dumped into them.
import fs from 'fs';
const folderUnderDirname = 'folder';
const fileExtension = '.html.twig';
const files = [
'filename-goes-here',
];
files.forEach(async file => {
await fs.promises.writeFile(`${__dirname}/${folderUnderDirname}/${file}${fileExtension}`, file, { flag: 'wx' });
@l3aconator
l3aconator / index.js
Created November 29, 2018 00:21
Utility function for dumping json onto page when using react
import React from 'react';
export const dump = data => {
return (
<pre
style={{
width: '100%',
wordWrap: 'break-word',
whiteSpace: 'pre-wrap',
padding: 20,
@l3aconator
l3aconator / codemirror-renderline-react.js
Last active November 2, 2018 21:08
React implementation of https://codemirror.net/demo/indentwrap.html "This page uses a hack on top of the "renderLine" event to make wrapped text line up with the base indentation of the line."
import React, { Component } from 'react';
import { Controlled as CodeMirror } from 'react-codemirror2';
import 'codemirror/mode/xml/xml';
import { countColumn } from 'codemirror';
class RenderCodeMirror extends Component {
constructor(props) {
super(props);
this.state = {
source: '<p>test</p>',
@l3aconator
l3aconator / countries.html
Created July 10, 2018 15:47
Country List Full Name Select Element
<select>
<option value="Afghanistan">Afghanistan</option>
<option value="Åland Islands">Åland Islands</option>
<option value="Albania">Albania</option>
<option value="Algeria">Algeria</option>
<option value="American Samoa">American Samoa</option>
<option value="Andorra">Andorra</option>
<option value="Angola">Angola</option>
<option value="Anguilla">Anguilla</option>
<option value="Antarctica">Antarctica</option>
@l3aconator
l3aconator / documentSection.html.twig
Created February 10, 2017 19:04
Modular document help
{% if page.header.documentSection == 'resources' %}
{% set documentCollection = taxonomy.findTaxonomy({'documentSection': 'resources' }) %}
{% elseif page.header.documentSection == 'materials' %}
{% set documentCollection = taxonomy.findTaxonomy({'documentSection': 'materials' }) %}
{% elseif page.header.documentSection == 'governance' %}
setTimeout(function(){
// Scroll into to view for percentage graphs
function isElementInViewport( elem ) {
var $elem = $( elem );
// Get the scroll position of the page.
var scrollElem = ((navigator.userAgent.toLowerCase().indexOf( 'webkit' ) != -1) ? 'body' : 'html');
var viewportTop = $( scrollElem ).scrollTop();
var viewportBottom = viewportTop + $( window ).height();