This file contains 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 resolvedPolyfills = {}; | |
polyfills.forEach(function(polyfill) { | |
resolvers.forEach(function(resolver) { | |
resolver(polyfill).forEach(function(targetPolyfill) { | |
resolvedPolyfills[targetPolyfill.name] = targetPolyfill | |
}) | |
}) | |
}); |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>DOM Recycler</title> | |
<style> | |
/* Styles not relevant to scrolling (just to make the demo look neat and tidy) */ | |
body { font-family: sans-serif; -webkit-text-size-adjust: 100% } |
This file contains 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
sudo: false | |
language: node_js | |
node_js: | |
- "0.10" | |
before_install: | |
- npm install -g Financial-Times/origami-build-tools#node-0.10 | |
- obt install | |
script: | |
- obt test | |
- obt verify |
This file contains 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
// Functional Helper: When lambda returns an array, compose concat and map to return a flattened result. | |
// See https://gist.github.com/samgiles/762ee337dff48623e729 for an example | |
Array.prototype.flatMap = function(lambda) { | |
return Array.prototype.concat.apply([], this.map(lambda)); | |
}; | |
// Mock, imagine this is some function that maps a modernizr test name to the polyfill.io nomenclature, if it doesn't map, | |
// it must return the name as is. Must always be an array. | |
function getListOfPolyFillsForModernizrTest(name) { | |
var mock = { |
This file contains 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
// [B](f: (A) ⇒ [B]): [B] ; Although the types in the arrays aren't strict (: | |
Array.prototype.flatMap = function(lambda) { | |
return Array.prototype.concat.apply([], this.map(lambda)); | |
}; |
This file contains 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
#INCLUDE "course.module" | |
PROTOCOL CONTROL | |
CASE | |
poison | |
: | |
PROTOCOL TAGGED.INT | |
CASE | |
normal; INT |
This file contains 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
#include "course.module" | |
PROC producer(VAL INT start, step, CHAN OF INT c!) | |
INT count: | |
SEQ | |
count := start | |
WHILE TRUE | |
SEQ | |
c ! count | |
count := count + step |
This file contains 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
import sys | |
import os | |
def pythonpath(): | |
# Remove filter if you don't care about cases such as: ':/path::', where members of the path are | |
# empty. It would be slightly faster to complete this operation if the filter was not run but the size of the | |
# input is likely to be small | |
os.pathsep.join(filter(lambda path: len(path) > 0, sys.path)) |
This file contains 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
void test_vec(double* restrict a, double* restrict b) { | |
int i; | |
double *x = __builtin_assume_aligned(a, 16); | |
double *y = __builtin_assume_aligned(b, 16); | |
for(i = 0; i < SIZE; i++) { | |
x[i] = x[i] + y[i]; | |
} | |
} |
This file contains 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
make wlvlang-jit PYPYPATH=~path/to/pypy | |
# This should pass | |
make test_all_jit | |
# Unfortunately the path to the script needs to be relative! (I should fix that) | |
bin/wlvlang-jit tests/benchmarks/thread-ring.wl 10 10 | |
# This should cause a segfault or: | |
# |