Skip to content

Instantly share code, notes, and snippets.

View noahlange's full-sized avatar

Noah Lange noahlange

View GitHub Profile
@noahlange
noahlange / gitsome.js
Last active August 16, 2020 19:37
Git + Gridsome
const spawn = require('@ahmadnassri/spawn-promise')
// exec before markdown import
module.exports = api =>
api.loadSource(actions =>
spawn("git", ["clone", process.env.MY_GIT_REPO, "dest"])
);
@noahlange
noahlange / comparative-adjective.js
Last active December 23, 2018 14:41
wink-pos-tagger: support for comparative adjectives
if (!pos) {
// may need to match either two or three characters (repeating consonants)
for (let c = 2; c <= 3; c++) {
// attempt to match
const match = (lexicon[word.slice(0, -c)] || [])[0];
if (match) {
pos =
// adjectives: taller, shorter
match === 'JJ'
? 'JJR'
@noahlange
noahlange / tpl.js
Created October 19, 2017 10:42
superjucks compiled template WIP
// sandbox.sjk
// Generated by Superjucks 0.2.0.
export default (() => {
return async (env, frame, ctx, runtime) => {
const lookup = runtime.env.lookup(ctx, frame);
const { Buffer, contains, entries, get } = runtime.env;
const sets = {};
const macros = {};
@noahlange
noahlange / nordifier.js
Last active October 6, 2017 12:02
Updates VSCode Nord theme to add more contrast for comments and background.
const { readdirSync, writeFileSync } = require('fs');
const { homedir } = require('os');
const colors = {
background: '#232731',
comment: '#818896',
highlight: '#292e39'
};
const paths = {
@noahlange
noahlange / barnes.js.md
Last active April 8, 2017 13:30
Barnes

Barnes

Barnes is a plugin-based build tool. It's a kind of like Metalsmith, just more so. It allows you to easily generate and manipulate lists of things with the array methods you know and love (.map(), .filter() and .reduce(), along with .series() and other made-up ones).

import Barnes from 'barnes';
import pandoc from 'barnes-pandoc';
@noahlange
noahlange / doc.tex
Created February 13, 2016 14:03
RPG Template
% Setup %
\documentclass[11pt]{scrbook}
\usepackage[paperwidth=5.5in, paperheight=8.5in]{geometry}
% Basics. %
\usepackage{xltxtra, xunicode, gensymb}
% Indexes + autogeneration %
\usepackage{makeidx, imakeidx}
export abstract class Distribution {
/**
* Protected instance properties
*/
protected _mean: number;
protected _variance: number;
/**
* Accessors for variance and mean.
import { Forms, Controller } from 'overland';
class MyCtrl extends Controller {
*form (next) {
const Post = this.models.get('post');
const form = new Forms.ModelForm(Post);
const data = yield Post.findOne({ id: 1 });
const html = yield form.render(data)
this.body = yield this.render({ form: html });
}