In this tutorial we're going to build a set of parser combinators.
We'll answer the above question in 2 steps.
- What is a parser?
- and, what is a parser combinator?
So first question: What is parser?
#![feature(inclusive_range_syntax, generators, generator_trait, never_type)] | |
use std::ops::{Generator, GeneratorState}; | |
fn is_div_by(n: u64, modulus: u64) -> bool { | |
if n % modulus == 0 { | |
true | |
} else { | |
false | |
} |
#!/usr/bin/env bash | |
# Released into the Public Domain. | |
# | |
# Original implementation in C by Brad Conte ([email protected]) <https://github.com/B-Con/crypto-algorithms> | |
# Ported to Bash (lol) by Josh Junon ([email protected]) <https://github.com/qix-> | |
# | |
# Yes, it's absolutely as slow as it looks. | |
# | |
# The only external dependency it has is on a utility called `od`, |
'use strict'; | |
// 1. Create the file: {projectRoot}/test.js | |
// 2. Install dependencies: npm i glob why-is-node-running | |
// 3. Run the tests: node --expose-internals test.js | |
const whyIsNodeRunning = require('why-is-node-running'); | |
const glob = require('glob'); | |
const Mocha = require('mocha'); |
module Main exposing (..) | |
{-| elm-package install elm-lang/navigation evancz/url-parser | |
-} | |
import Html exposing (Html, caption, div, table, tbody, td, text, th, thead, tr) | |
import Navigation exposing (Location) | |
import String | |
import UrlParser exposing (Parser, (</>), map, oneOf, s, int, string, top, parseHash) |
This describes how I setup Atom for an ideal Clojure development workflow. This fixes indentation on newlines, handles parentheses, etc. The keybinding settings for enter (in keymap.cson) are important to get proper newlines with indentation at the right level. There are other helpers in init.coffee and keymap.cson that are useful for cutting, copying, pasting, deleting, and indenting Lisp expressions.
The Atom documentation is excellent. It's highly worth reading the flight manual.
Here's how you validate a mailgun webhook in Node.js (as per the mailgun docs for securing webhooks)
'use strict';
var scmp = require('scmp')
, crypto = require('crypto')
. mailgunPrivateKey = 'XXXXXXXXXXXXX'
, mailgunTokens = {}
, mailgunExpirey = 15 * 60 * 1000
When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:
const Article = require('../../../../app/models/article');
Those suck for maintenance and they're ugly.
var oneDay = 86400; | |
module.exports = function (connect) { | |
var Store = connect.session.Store | |
, PGStore; | |
PGStore = function (options) { | |
var self = this; |
The spec has moved to a repo: https://github.com/defunctzombie/package-browser-field-spec to facilitate collaboration.