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
Problem: You want to access Futon on a remote server but do not want port 5984 to listen for outside connections. | |
Solution: Tunnel through a local port using SSH. [1] | |
Example: | |
ssh -L5984:127.0.0.1:5984 ssh.example.com | |
[1] http://wiki.apache.org/couchdb/Frequently_asked_questions |
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
Had some time during the weekend to tinker with CouchApps and Evently. | |
0 - Preliminaries | |
* setup couchdb 0.11 and couchapp | |
* remove old couchdb versions lying around your system | |
* there's a current issue with ubuntu 9.10 and javascript libraries (installing libmozjs removes firefox) | |
* a CouchApp is a wrapper for a design doc | |
1 - Where to start? |
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 sys = require("sys"), http = require('http'), encode = require('./encoding'); | |
function createAuthorization(username, password) { | |
return "Basic " + encode.base64(username + ":" + password); | |
} | |
Object.prototype.filter = function(fn) { | |
var result = {}; | |
for (var name in this) { | |
if (this.hasOwnProperty(name)) { |
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 sys = require('sys'), http = require('http'), twitter = require('./twitter'), couch = require("./node-couch"); | |
Array.prototype.each = function(fn) { | |
for (var i = 0; i < this.length; i++) { | |
var item = this[i]; | |
fn.call(null, item); | |
} | |
return this; | |
}; |
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
(as of iOS 4.0.1) attaching the player to a view: | |
[[player view] setFrame: [viewForMovie bounds]]; | |
[self.viewForMovie addSubview:player.view]; |
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
Header scan and Function scan [1] | |
Reading code is like reading the Talmud [2] | |
Writing readable code | |
* function names | |
* variable names | |
* loops (hard to debug) | |
* short code (when to split functions) |
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
iOS app running on armv7. | |
MobileVLCAppDelegate | |
MVLCMovieViewController | |
* creates a VLCMediaPlayer (sets delegate to itself and drawable surface to movieView) | |
* sets media to the URL provided | |
* tells media player to play |
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
Objective-C classes interfacing with libvlc. | |
VLCLibrary | |
* sharedInstance | |
* creates default params | |
* calls libvlc_new_with_builtins by passing lib_vlc_params | |
VLCMedia mediaWithPath: | |
* uses a shared instance to create a VLCMedia object (see initWithURL; VLCLibrary) | |
* libvlc_media_new_location (see media.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
access | |
decoder | |
* DecoderThread | |
* DecoderProcess | |
demux | |
stream |
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
(see crypto/include/crypto_kernel.h) | |
Types | |
* crypto_kernel_state_t | |
* cipher_type_id_t | |
* auth_type_id_t | |
* crypto_kernel_t (at most one instance) | |
Functions | |
* crypto_kernel_init |