Skip to content
View calculator.js
<!DOCTYPE html>
<html>
<head>
<title>Data loading/binding demo</title>
<style>
body {
font-family: monospace, Helvetica, sans-serif;
padding: 20px;
margin: 0px;
background: #E6E7E8;
View benchmark-template.js
/**
* Simple benchmark copy paste for browsers using Benchmark.js
* See their documentation: https://benchmarkjs.com/
* Edit the different suite add() sections below to change your tests or add new ones.
*/
var Script = function(url) {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
po.src = url;
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
View path-val.js
// via http://www.redotheweb.com/2015/09/18/declarative-imperative-js.html
function getValue(object, propertyName) {
if (!propertyName) throw new Error('Impossible to set null property');
return typeof object === 'undefined' ? undefined : object[propertyName];
}
function getNestedValue(object, propertyName) {
return propertyName.split('.').reduce(getValue, object);
}
View reduce.js
var input = [[2,6],[3,5],[7,21],[20,21]];
var expectedOutput = [[2,6],[7,21]];
var rangesOverlap = function(range1, range2) {
return (
(range1[1] >= range2[0] && range1[1] <=range2[1]) ||
(range1[0] <= range2[0] && range1[1] >= range2[0])
);
};
View es5-6.js
var params = { t: 123, type: 'mytype', channelId: 'mychan', badge:'thebadge' };
var allowedPersonParams = ["type", "channelId", "badge", "since", "until"];
// ES5
var result = {};
allowedPersonParams.forEach(function (paramName) {
if (currentParams[paramName]) {
result[paramName] = currentParams[paramName];
}
View gist:cbf92b33db85d31eff86
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>console test</title>
<link rel="shortcut icon" type="image/png" href="lib/jasmine-2.2.0/jasmine_favicon.png">
<link rel="stylesheet" href="lib/jasmine-2.2.0/jasmine.css">
<script src="lib/jasmine-2.2.0/jasmine.js"></script>
View gist:0e7d096151e0ca02a020
:%s/\/\*\{-1}\_.\{-}\*\///g
View gist:ac4594ce5d4d6e3357ba
/*
Gmail Client (ideas)
Usage:
var gmailClient = newGmailClient(myAccessToken);
var response = gmailClient.execute({
url: "users/me/messages",
headers: {},
View willen-zum-leben
Zwei Dinge hat das Denken zu leisten: uns aus der naiven zur vertiefen Welt-
und Lebensbejahung zu füren und uns von ethischen Regungen zu einer
denknotwendigen Ethic gelangen zu lassen.
Vertiefe Welt- und Lebensbejahung besteht darin, dass wir den Willen haben,
unser Leben und alles durch uns irgendwie beeinflussbare Sein zu erhalten und
auf seinen höchsten Wert zu bringen. Sie verlangt von uns, dass wir alle
Ideale der materiellen und geistigen Vervollkommnung des Menschen, der
Gesellschaft und der Menschheit denken und uns durch sie zu stetem Wirken und
stetem Hoffen bestimmen lassen. Sie erlaubt uns nicht, uns auf uns selber
View rspec-guides.markdown

General guides

  • Use describe blocks for objects and methods ("given" scenarios)
  • Use context blocks for "when" scenarios
  • Avoid spec descriptions longer than 40 characters. Split into contexts if longer.
  • Prefer expect syntax
  • Use before blocks at the lowest scope necessary
    • e.g. start within it blocks, then move into describe, then only if necessary for all tests put outside of those.
  • Use validation tests and place them at the top of the describe block
Something went wrong with that request. Please try again.