This file contains hidden or 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 start = require("uniweb"); | |
| //var read = require("fs").readFileSync; | |
| function hello(socket) { | |
| socket.on("message", function(msg) { | |
| socket.send("alert(\"" + msg + "\");"); | |
| }); | |
| socket.send("socket.send(\"Hello World!\");"); | |
| } |
This file contains hidden or 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 start = require("uniwebjs"); | |
| //var read = require("fs").readFileSync; | |
| function hello(socket, data) { | |
| if (data) { | |
| socket.run(function(data) { | |
| window.alert(data); | |
| }, data); | |
| } else { | |
| socket.run(function() { |
This file contains hidden or 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 orig = "<!doctype html>"; | |
| orig = orig.concat("<meta charset=\"utf-8\">"); | |
| orig = orig.concat("<title></title>"); | |
| orig = orig.concat("<script>"); | |
| orig = orig.concat("var socket = new WebSocket(\"url\");"); | |
| orig = orig.concat("socket.onmessage = function (msg) {"); | |
| orig = orig.concat("eval(msg.data);"); | |
| orig = orig.concat("};"); | |
| orig = orig.concat("</script>"); |
This file contains hidden or 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
| all: verbatim.h | |
| verbatim.h: txt2cs.sed def.h sim.c | |
| printf '#define %s \\\n%s\n\n' >$*.tmp \ | |
| INDEF "$$(sed -f txt2cs.sed def.h)" | |
| printf '#define %s \\\n%s\n' >>$*.tmp \ | |
| INSIM "$$(sed -f txt2cs.sed sim.c)" | |
| mv $*.tmp $@ | |
| clean: |
This file contains hidden or 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
| TEST = 0 | |
| all: gentree | |
| ./gentree $(TEST) >output.c | |
| $(MAKE) output | |
| [ $(TEST) = $$(./output) ] | |
| clean: | |
| -rm -f gentree output output.c |
This file contains hidden or 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
| #!/usr/xpg4/bin/sh | |
| set -Cex | |
| export PATH=/usr/xpg6/bin:/usr/xpg4/bin:/usr/bin:/usr/sbin | |
| MIN=10 | |
| MAX=99 | |
| POOL=busy | |
| ROOT=/opt/custom |
This file contains hidden or 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
| SCRIPT = "awk -F , -f cut.awk <input.csv | ./count >output.txt" | |
| .POSIX: | |
| all: cut.awk count input.csv | |
| time sh -c $(SCRIPT) | |
| clean: | |
| -rm -f count output.txt |
This file contains hidden or 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
| .POSIX: | |
| all: wordexp | |
| ./wordexp | |
| clean: | |
| -rm -f wordexp |
This file contains hidden or 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
| all: nonce | |
| time ./nonce | |
| nonce: nonce.c data.c | |
| gcc -O3 -Wall -Werror nonce.c -o $@ | |
| data.c: parse.sed work.js | |
| sed -n -f parse.sed work.js >$@ | |
| clean: |
This file contains hidden or 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
| all: ram0 | |
| ./ram0 | |
| clean: | |
| -rm -f ram0 | |
| .SUFFIXES: .v | |
| .v: | |
| iverilog -Wall -DSIM -o $@ $< |