-
(i) insert (was di:)
-
(d) drop
-
(dn) drop if null
-
(r) remove (was p:null)
-
(p) pick up
-
(e) edit
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
// This version calls the _write callback after the data is sent. | |
Duplex = require('stream').Duplex; | |
var BCSocket = function(...) { | |
Duplex.call(this, {objectMode: true}); | |
this.buffer = []; | |
}; | |
BCSession.prototype = Object.create(Duplex.prototype); |
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> | |
<title>Cool game</title> | |
<style> | |
.centerbox { | |
/* flexbox, por favor */ | |
display: flex; | |
align-items: center; | |
justify-content: center; | |
width: 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
assert = require 'assert' | |
_a = 'a'.charCodeAt(0) | |
_f = 'f'.charCodeAt(0) | |
_A = 'A'.charCodeAt(0) | |
_F = 'F'.charCodeAt(0) | |
hexForChar = (c, pos = 0) -> | |
ascii = c.charCodeAt pos | |
switch |
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
{Delta} = require 'tandem-core' | |
utils = require('tandem-core/build/delta_generator').getUtils() | |
tandem = require './tandem' | |
tandem.generateRandomDoc = -> | |
Delta.getInitial 'abcde' | |
tandem.generateRandomOp = (delta) -> | |
newDelta = utils.getRandomDelta delta, 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
{Duplex} = require 'stream' | |
livedb = require 'livedb' | |
sharejs = require './lib' | |
backend = livedb.client livedb.memory() | |
#backend = livedb.client livedbMongo('localhost:27017/test?auto_reconnect', safe:false) | |
share = sharejs.server.createClient {backend} |
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
# Get your word list: | |
# curl 'http://www-01.sil.org/linguistics/wordlists/english/wordlist/wordsEn.txt' -O | |
fs = require 'fs' | |
words = for word in fs.readFileSync('wordsEn.txt', 'utf8').split '\n' when word != '' | |
if word[word.length - 1] is '\r' | |
word[...word.length - 1] | |
else | |
word |
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
$ ping 192.168.1.254 | |
PING 192.168.1.254 (192.168.1.254): 56 data bytes | |
Request timeout for icmp_seq 0 | |
Request timeout for icmp_seq 1 | |
Request timeout for icmp_seq 2 | |
Request timeout for icmp_seq 3 | |
Request timeout for icmp_seq 4 | |
Request timeout for icmp_seq 5 | |
Request timeout for icmp_seq 6 | |
Request timeout for icmp_seq 7 |
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
# Simple idea: Think of the process in a set of phases which happen in order: | |
# | |
# First the pickup phase marks objects for pickup. After the pickup phase runs, | |
# we go through and pick up all the objects. (Notably, you can still decend | |
# into picked up objects after marking them during the pickup phase). | |
# | |
# Then maybe we have an edit phase where we make all the normal edits. | |
# | |
# Finally we have a drop phase where we go through and insert back all the | |
# things we picked up. |
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 <stdio.h> | |
#include <stdlib.h> | |
#include "http_parser.h" | |
int on_message_begin(http_parser *parser) { | |
printf("on_message_begin\n"); | |
return 0; | |
} | |
int W(const char *name, const char *at, size_t length) { |
OlderNewer