-
Notifications
You must be signed in to change notification settings - Fork 2
/
TODO
186 lines (176 loc) · 6.12 KB
/
TODO
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
[ work in progress ]
Things to do... oh so many
* Better TODO, README, overall documentation
Brainstorm zone *you have been warned*
Philosophies:
Server independence: should essentially be able to save the koala site and still use it
Language:
Keywords:
"in" - gets return value of last command
"of" - dereference operator
"?" - evaluates to boolean
Debug mode: "say", "ask" map to console,
otherwise uses alert(), prompt()
Units as part of number literals
ex. 3 inches -> { value: 3, type: 'number', unit: 'inches' }
can do conversions between units with:
measurement: distance, time, temperature, etc
ratio relative to a fixed unit: ie, mm=.001, cm=.01, m=1
ex. units = {
distance: {
mm: .001,
cm: .01,
m: 1, ....
File browser:
Need icons (PD, GPLv3...)
Default icons
Custom (uploaded) icons
Drag and drop support
Drag files in to upload
Drag files out to download
Multiple views:
List, icon
Changeable by CSS class?
Backup to localStorage
Save to server when available
Maintain whether it has been uploaded or not
Image editor:
Using HTML5 canvas
get data using canvas.toDataURL([mime="image/png"]);
Resources:
Using pure CSS to apply alternating styles
http://www.w3.org/Style/Examples/007/evenodd.en.html
CSS system colors and appearance for better OS integration
http://www.iangraham.org/books/xhtml1/appd/update-23feb2000.html
www.w3schools.com/cssref/css3_pr_appearance.asp
Node.js module that creates a common namespace between server and clients
http://nowjs.com/
DOM manipulation with fragments could give significant performance improvements
http://ejohn.org/blog/dom-documentfragments/
Directory walk in node.js
http://stackoverflow.com/questions/5827612/node-js-fs-readdir-recursive-directory-search
Drag & Drop, Reading local files from JavaScript
http://www.html5rocks.com/en/tutorials/dnd/basics/
http://www.html5rocks.com/en/tutorials/file/dndfiles/
http://www.html5rocks.com/en/tutorials/casestudies/box_dnd_download.html
https://developer.mozilla.org/En/DragDrop/Drag_and_Drop
https://developer.mozilla.org/En/DragDrop/DataTransfer
https://developer.mozilla.org/En/DragDrop/Recommended_Drag_Types
http://www.thecssninja.com/javascript/gmail-dragout
http://help.dottoro.com/ljmpcqdb.php
http://paul.kinlan.me/drag-to-desktop-in-js/
http://stackoverflow.com/questions/4100927/chrome-filereader
Drag selection area
http://stackoverflow.com/questions/4002059/get-dom-elements-inside-a-rectangle-area-of-a-page
http://threedubmedia.com/code/event/drop/demo/selection
Node.js based minification
https://github.com/GoalSmashers/clean-css
https://github.com/mishoo/UglifyJS
https://github.com/Qard/crsh
In browser interpretters/compilers; prolog, lisp, coffeescript, basic
http://ioctl.org/logic/prolog1
http://lambda-the-ultimate.org/node/892
http://joeganley.com/code/jslisp.html
http://coffeescript.org/documentation/docs/nodes.html
http://www.calormen.com/applesoft/
Node.js example server
https://github.com/ry/node_chat
AJAX
http://www.w3schools.com/ajax/ajax_xmlhttprequest_onreadystatechange.asp
http://microajax.googlecode.com/svn/trunk/microajax.js
Semi-fluid CSS layout
http://www.alistapart.com/articles/holygrail
Some thoughts on coding standards
http://adamspiers.org/computing/Linus-Kernel-CodingStyle
Icons?
http://bogo-d.deviantart.com/art/Project-Icons-v-2-1-8-155863784
Server Sent Events
http://www.w3.org/TR/eventsource/
http://html5doctor.com/server-sent-events/
https://github.com/Yaffle/EventSource
https://github.com/remy/eventsource-h5d
Cursor position in IE
http://www.webdeveloper.com/forum/showthread.php?t=74982
Multi-User Edit
https://github.com/Pita/etherpad-lite
JS Security
http://pajhome.org.uk/crypt/md5/
http://www.ietf.org/rfc/rfc2104.txt
Node.js Reference
http://nodejs.org/docs/v0.4.9/api/process.html
http://nodejs.org/docs/v0.4.9/api/crypto.html
http://nodejs.org/docs/v0.4.9/api/globals.html
HTML5 Polyfills
https://github.com/Modernizr/Modernizr/wiki/HTML5-Cross-Browser-Polyfills
Flash-like WebGL API
http://lib.ivank.net
CSS Animation/Transition stuff
http://www.impressivewebs.com/css3-transitions-javascript/
http://marakana.com/static/bookshelf/css3_transitions_tutorial/javascript.html
http://ryanflorence.com/cssanimation/
http://stackoverflow.com/questions/2794148/css3-transition-events
CSS toggle switch
https://github.com/ghinda/css-toggle-switch
http://jsfiddle.net/DMfvx/88/
Grammar
http://www.lysator.liu.se/c/ANSI-C-grammar-y.html
~ scraps ~
CLIENT ===========
== Sort by property
array.sort(function(a, b) {
return a.prop - b.prop;
});
== which element has keyboard focus (read only)
document.activeElement
// https://developer.mozilla.org/en-US/docs/HTML/Global_attributes
== element can gain keyboard focus
element.tabindex = -1;
SERVER ===========
== Dealing with Buffers & Strings, Base64 & binary
> console.log(new Buffer("Hello World").toString('base64'));
SGVsbG8gV29ybGQ=
> console.log(new Buffer("SGVsbG8gV29ybGQ=", 'base64').toString('ascii'))
Hello World
--
var base64Data = req.rawBody.replace(/^data:image\/png;base64,/,""),
var dataBuffer = new Buffer(base64Data, 'base64');
require("fs").writeFile("out.png", dataBuffer, function(err) {
console.log(err);
});
--
fs.readFile(image_origial, function(err, original_data){
fs.writeFile('image_orig.jpg', original_data, function(err) {});
var base64Image = original_data.toString('base64');
var decodedImage = new Buffer(base64Image, 'base64');
fs.writeFile('image_decoded.jpg', decodedImage, function(err) {});
});
== Walking a directory
function walk(root, fileCb, doneCb) {
fs.readdir(root, function(err, files) {
if (err) {
//fileCb(err);
} else {
for( var i = 0; i < files.length; i++ ){
var file = root + '/' + files.shift();
fs.stat(file, function(err, stat) {
if (err) {
//doneCb(err);
} else {
if (stat.isFile()) {
fileCb(file);
} else {
walk(file, fileCb);
}
}
});
}
//doneCb && doneCb(false);
}
});
}
== MD5
md5 = function (str) {
var md5 = require('crypto').createHash('md5');
md5.update(str)
return md5.digest('hex')
};