This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import namedtuple | |
# These map directly to the 8 regular brainfuck instructions. The | |
# exception is the offset parameter, which would be 0 in regular | |
# brainfuck, but can here indicate an offset from the current cell at | |
# which the operation should be applied. | |
Add = namedtuple('Add', ['x', 'offset']) | |
Sub = namedtuple('Sub', ['x', 'offset']) | |
Right = namedtuple('Right', ['x']) | |
Left = namedtuple('Left', ['x']) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*STRIPS PDDL parser for http://pegjs.org/online | |
For example of parsing this grammar, see https://gist.github.com/primaryobjects/1d2f7ee668b62ca99095 | |
Example PDDL domain to parse: | |
(define (domain random-domain) | |
(:requirements :strips) | |
(:action op1 | |
:parameters (?x1 ?x2 ?x3) | |
:precondition (and (S ?x1 ?x2) (R ?x3 ?x1)) | |
:effect (and (S ?x2 ?x1) (S ?x1 ?x3) (not (R ?x3 ?x1)))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
grammar.txt: saved from https://gist.github.com/primaryobjects/22363e71112d716ea183 | |
domain.txt: | |
(define (domain random-domain) | |
(:requirements :strips :typing) | |
(:action op1 | |
:parameters (?x1 ?x2 ?x3) | |
:precondition (and (S ?x1 ?x2) (R ?x3 ?x1)) | |
:effect (and (S ?x2 ?x1) (S ?x1 ?x3) (not (R ?x3 ?x1)))) | |
(:action op2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"domain":"random-domain", | |
"requirements":[ | |
"strips", | |
"typing" | |
], | |
"actions":[ | |
{ | |
"action":"op1", | |
"parameters":[ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
pegjs grammar for parsing a PDDL STRIPS domain problem. Example problem: | |
(define (problem random-pbl1) | |
(:domain random-domain) | |
(:init | |
(S B B) (S C B) (S A C) | |
(R B B) (R C B)) | |
(:goal (and (S A A)))) | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var strips = require('strips'); | |
var util = require('util'); | |
// Load the domain and problem. | |
strips.load('./domain-cake.pddl', './problem-cake.pddl', function(domain, problem) { | |
var S = []; | |
// S0 - 1 node per literal in initial state. | |
for (var i in problem.states[0].actions) { | |
var literal = problem.states[0].actions[i]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
:loop | |
:: Start timer. | |
@set /A _tic=%time:~0,2%*3600^ | |
+%time:~3,1%*10*60^ | |
+%time:~4,1%*60^ | |
+%time:~6,1%*10^ | |
+%time:~7,1% >nul |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Download and install node.js at http://nodejs.org/download/ | |
2. Copy your node.js project files to C:\Users\YOUR_USERNAME\Documents\SITENAME | |
3. Open Windows Firewall port 80. | |
4. Open Windows Powershell and type: | |
$env:PORT = 80 | |
cd C:\Users\YOUR_USERNAME\Documents\SITENAME |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
html-minifier | |
https://www.npmjs.com/package/html-minifier | |
UglifyCSS | |
https://github.com/fmarcia/UglifyCSS | |
UglifyJS2 | |
https://github.com/mishoo/UglifyJS2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Razor Syntax for node.js views | |
https://github.com/kirbysayshi/vash#syntax-example | |
Example Controller: | |
exports.page = function(req, res) { | |
res.render('page.vash', { name: 'John Doe', colors: [ 'red', 'green', 'blue' ] }); | |
}; | |
Example Views: |