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
// require() some stuff from npm (like you were using browserify) | |
// and then hit Run Code to run it on the right | |
var slick = require('slick'); | |
var sMyString = "<foo><bar></bar></foo>"; | |
var oParser = new DOMParser(); | |
var oDOM = oParser.parseFromString(sMyString, "text/xml"); | |
console.log(slick('bar', oDOM)); |
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
#!/bin/sh | |
usage () { | |
cat <<USAGE | |
Helper commands: | |
tags - List all tags relevant to this trunk | |
branches - List all branches relevant to this trunk | |
tag - Tag a trunk or branch copy. | |
branch - Branch a trunk or tag working copy. |
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
// conversions | |
let c2i = x => x(y => y + 1, 0) | |
let c2star = x => x(y => y + '*', '') | |
let c2b = x => x('True', 'False') | |
let c2a = xs => xs((y, ys) => [c2i(y)].concat(ys), []) | |
// numbers | |
let zero = (s,z) => z | |
let one = (s,z) => s(z) |
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
package main | |
import "fmt" | |
func quicksort(list []int) []int { | |
l := len(list) | |
if (l <= 1) { | |
return list | |
} |
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
"use strict"; | |
function toArray(thing) { | |
if (Array.isArray(thing)) return thing; | |
return Array.prototype.slice.call(thing); | |
} | |
function head(arr) { | |
return arr[0]; | |
} |
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 filter = require('prime/array/filter'); | |
var slice = Array.prototype.slice; | |
var curry = function(fn){ | |
var args = slice.call(arguments, 1); | |
return function(self){ | |
fn.apply(null, [self].concat(args); | |
}; | |
}; |
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
(function () { | |
var modules = {}, cache = {}; | |
if (typeof define == 'undefined') { | |
window.define = function (id, factory) { | |
modules[id] = factory; | |
}; | |
window.require = function (id) { | |
var module = cache[id]; | |
if (!module) { | |
module = cache[id] = {}; |
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
# use the split-generics branch of prime. | |
wrup -r prime ../../www/prime/index.js -r bind ../../www/prime/function/bind -o prime.js |
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
function multiply(multiplicant, multiplier){ | |
var product = 0; | |
for (var i = 0; i < 32; i++){ | |
product += (multiplier & 1) ? multiplicant : 0; | |
multiplicant <<= 1; | |
multiplier >>= 1; | |
} |
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
.text | |
j main # Jump to main-routine | |
.data | |
str1: .asciiz "Insert the array size \n" | |
str2: .asciiz "Insert the array elements,one per line \n" | |
str3: .asciiz "The sorted array is : \n" | |
str5: .asciiz "\n" | |
.text |
NewerOlder