This Gist was automatically created by Carbide, a free online programming environment.
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"/> | |
<title>Untitled benchmark</title> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script> | |
<script src="https://wzrd.in/standalone/htmlparser2@3"></script> | |
<script src="https://wzrd.in/standalone/css-select@1"></script> | |
<script src="./suite.js"></script> | |
</head> |
lamdba
refers to a lambda function, in this case x => x * 2
These were tested by running each one 2500 times, on an array of 2500 values (from 0 to 2499).
| **Chrome** | **Firefox** | **Safari** |
--------------------|------------|-------------|------------|
_.map(lambda)
| 127 ms | 116 ms | 114 ms |
R.map(lambda)
| 87 ms | 83 ms | 84 ms |
Array#map(lambda)
| 2.57 sec | 2.58 sec | 2.59 sec |
#!/usr/bin/python | |
import subprocess | |
# PyObjC-related imports | |
from AppKit import NSApplication, NSSystemDefined, NSApplicationActivationPolicyProhibited | |
from PyObjCTools import AppHelper | |
KEY_UP = 11 |
<script src="https://cdn.rawgit.com/straker/html-tagged-template/043f11d7659365d25e3b0784bcd613d1c738253b/index.js"></script> | |
<div class="wrapper"> | |
<div class="bars"></div> | |
<div class="grad"></div> | |
</div> | |
<style> | |
.wrapper { | |
display: flex; |
old: 'dept: $NOR dept: AMCON dept: GCON gereq: HWC year: 2015' | |
new: 'dept: !AMCON and !GCON gereq: HWC year: 2015' | |
op:: $and | |
value: | |
- op: $and | |
value: | |
- {op: $ne, key: 'dept', value: 'AMCON'} | |
- {op: $ne, key: 'dept', value: 'GCON'} | |
- op: $eq |
#!/bin/bash | |
set -e | |
root=$(pwd) | |
for file in "$@"; do | |
cd "$file" | |
pwd | |
if [[ -f index.xml.gz ]]; then |
This current version is very much broken up between several parts.
Eventually, the Hanson file will go in, and a JSON file will come out; then evaluate
will take the JSON, a list of courses, and a map of overrides, and return a mutated ("enhanced") object with enough info (hopefully) to render the sidebar info pane.
Currently, though, the glue between the PEGjs parser and the file reader isn't written, so it has to be done manually.
Each "result" string must be fed into the peg, then copied back into the Hanson file. The Hanson file also needs to have types assigned to the requirements themselves, and enough braces put in that it becomes valid JSON.
Might be easiest to use the online JS-yaml tool at http://nodeca.github.io/js-yaml, then copy each result string into the online PEGjs parser at http://pegjs.org/online, then copy it back to replace the result string with the result object.
"use strict"; | |
var React = require('react'); | |
var Router = require('react-router'); | |
var Link = Router.Link; | |
var Index = React.createClass({ | |
mixins: [ Router.State ], | |
render: function () { | |
var name = this.getPath(); |
*, *::before, *::after { | |
box-sizing: border-box; | |
} | |
body { | |
margin: 0; | |
font-family: Fira Sans, Calibri, Lucida Grande, Verdana, sans-serif; | |
font-weight: 300; | |
color: #4d4d4f; | |
} |