Skip to content

Instantly share code, notes, and snippets.

View jkarttunen's full-sized avatar

Juha Karttunen jkarttunen

View GitHub Profile
function assert (actual, expected, msg, su) {
if (!window.assertions) {
window.assertions = {success:0, fail:0};
}
if (expected !== actual) {
var message = msg || 'expected ' + expected + ' but got ' + actual;
console.warn(message);
window.assertions.fail = window.assertions.fail +1
} else {
window.assertions.success = window.assertions.success +1;
@jkarttunen
jkarttunen / base64.js
Last active August 29, 2015 14:19 — forked from chrisveness/base64.js
/**
* Encode string into Base64, as defined by RFC 4648 [http://tools.ietf.org/html/rfc4648].
* As per RFC 4648, no newlines are added.
*
* Characters in str must be within ISO-8859-1 with Unicode code point <= 256.
*
* Can be achieved JavaScript with btoa(), but this approach may be useful in other languages.
*
* @param {string} str ASCII/ISO-8859-1 string to be encoded as base-64.
* @returns {string} Base64-encoded string.
@jkarttunen
jkarttunen / 1_getting_started_with_dev.md
Last active August 29, 2015 14:06
Front End Learning resources

Getting started with front-end development

Books should be available in Siili library, also in dead-trees format. Some of the sites are paywalled but worth it, so prefer these over free copies. If something is missing, please have it bought.

Thinking and concepts

Workflows and tools

  • To get you started without scary tool installs and command line interface, you can use Prepros.io to play with modern web development workflow, packaged in one app.