Skip to content

Instantly share code, notes, and snippets.

@CMCDragonkai
CMCDragonkai / http_streaming.md
Last active December 24, 2025 06:08
HTTP Streaming (or Chunked vs Store & Forward)

HTTP Streaming (or Chunked vs Store & Forward)

The standard way of understanding the HTTP protocol is via the request reply pattern. Each HTTP transaction consists of a finitely bounded HTTP request and a finitely bounded HTTP response.

However it's also possible for both parts of an HTTP 1.1 transaction to stream their possibly infinitely bounded data. The advantages is that the sender can send data that is beyond the sender's memory limit, and the receiver can act on

function key(c) {
$('#drums [data-pitch='+(c - 1)+']').click()
}
setInterval(play, 200)
var list1 = [[3,4], [], [4], [], [2], [] , [4], [2], [4], [2], [1], [], [2, [4]],[], [4], []]
var list2 = [[1, 3], [4], [2, 4], [4], [1, 4], [1, 4], [2, 4], [4]]
var i = 0;
list = list1
function play(){
i = i % list.length
# METEOR CORE:
Anywhere: Meteor.isClient
Anywhere: Meteor.isServer
Anywhere: Meteor.startup(func)
Anywhere: Meteor.absoluteUrl([path], [options])
Anywhere: Meteor.settings
Anywhere: Meteor.release
@ilyakatz
ilyakatz / pre-commit
Last active February 22, 2023 14:51
helpful precommit hooks
#!/bin/bash -l
# A git hook script to find and fix trailing whitespace
# in your commits. Bypass it with the --no-verify option
# to git-commit
#
.git/hooks/pre-commit-master-no-no
if [[ $? == 1 ]]
then
@ufologist
ufologist / douban_reader.js
Created January 17, 2013 12:20
如何导出/下载豆瓣阅读中的电子书
/**
* 分析豆瓣阅读查看电子书的逻辑
*
* 主要用到的JavaScript为
* 1. OzJS(管理模块)
* 2. jQuery(base库)
* 3. Backbone.js(web application框架)
*
* 过程分析
* --------
@jimbojsb
jimbojsb / gist:1630790
Created January 18, 2012 03:52
Code highlighting for Keynote presentations

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2:

Strophe.addConnectionPlugin('connectionmanager', {
pingTime: 10000, // the time in ms between each ping
timeoutTime: 8000, // the time in ms to wait for a ping to return
pingInterval: null,
connection: null,
init: function(connection) {
this.connection = connection;
},