May 2011
79 posts
2 tags
Async provides around 20 functions that include... →
6 tags
nodeunit adapter for Sinon.JS. Automatic... →
7 tags
Fuck with javascript null and 'undefined'
This two nice explanations will enlighten you:
- How to check null, undefined or blank variable in JavaScript: http://stackoverflow.com/questions/5515310/how-to-check-null-undefined-or-blank-variable-in-javascript - typeof === “undefined” vs. != null: http://stackoverflow.com/questions/2703102/typeof-undefined-vs-null
5 tags
Sinatra with Redis on Cloud Foundry
nosql:
The workshop takes you through creating a Sinatra application using sample code from here . Once the Sinatra application which leverages Twitter is working, the workshop then takes you through adding Redis to your application. Finally the workshop ends after taking you through scaling your application instances up and then back down.
Only 15 minutes to get it up and running:
Original...
3 tags
Unit Test in Nodejs
- Unit Test in Node : http://caolanmcmahon.com/posts/unit_testing_in_node_js?&_suid=345
- http://cjohansen.no/en/node_js/unit_testing_node_js_apps
- Nodeunit tesing webapp http://blog.kadirpekel.com/2011/03/14/testing-nodejs-powered-web-applications/
2 tags
So you want to create your own custom Form Based... →
2 tags
Simple OAuth Provider
- http://code.google.com/p/oauth/
- CSharp example : http://oauth.googlecode.com/svn/code/csharp/OAuthBase.cs
3 tags
To find if a key/field exists in your document use... →
6 tags
2 useful links for Mongo users
- MongoDB safe and fsync Explained : http://groups.google.com/group/mongodb-user/msg/36ba2b821c438728
- Update modifier list : http://www.mongodb.org/display/DOCS/Updating
5 tags
Relationship in MongoDB?
The original question of this story from Stackoverflow is Many to many update in MongoDB without transactions
Answer by gates:
You have multiple legitimate ways to do this. So they key concern is how you plan to query for the data, (i.e.: what queries need to be fast)
Here are a couple of methods.
Method #1: the “links” collection
You could build a collection that simply contains...
2 tags
XULRunner →
XULRunner is a runtime environment developed by the Mozilla Foundation to provide a common back-end for XULapplications. It replaced the Gecko Runtime Environment, a stalled project with a similar purpose.
Uses:
Beginning with version 3.0, Mozilla Firefox uses a “private” XULRunner[3], meaning the framework is installed locally in the application directory.
The fourth installment...
4 tags
Node.js, and OAuth, and flickr! Oh, my! →
3 tags
scons - software build/construction tool →
SCons is an Open Source software construction tool—that is, a next-generation build tool. Think of SCons as an improved, cross-platform substitute for the classic Makeutility with integrated functionality similar to autoconf/automake and compiler caches such as ccache. In short, SCons is an easier, more reliable and faster way to build software.
SCons is a fantastic build system, written in...
2 tags
Today Mongo News
- http://www.theregister.co.uk/2011/05/25/the_once_and_future_mongodb/
- http://engineering.foursquare.com/2011/05/24/fun-with-mongodb-replica-sets/
[from NoSQL]
เอาเวลาวิจารณ์คนอื่นมาสะท้อนมองเงาตัวเอง
สิ่งสำคัญอยู่ที่ความหนักแน่น...
– Ochawin
5 tags
How Zynga Scale? →
Zynga hosts prior projects on Amazon EC2, and afterward moves mature (popular) games into their private ZCloud in the lease data center. This is interesting!
3 tags
Annoying.js →
In January I came across a website that had a whole slew of JavaScript that attempted to prevent you from selecting text, right clicking or dragging any content onto your desktop. I decided to copy the JavaScript and create a library with examples of JavaScript techniques you can use if you want to scare your visitors away, or want to piss them off. Annoying.js is the result.
3 tags
Make custom input checkbox and radio (CSS) →
ผลลัพธ์คือสิ่งที่คาดหวัง
ผลที่ตามมาคือสิ่งที่คุณได้รับ..
– Unknown
1 tag
Psychology Blog →
4 tags
Hadoop in Azure →
3 tags
The 11 Commandments of Benchmarking
Consistency
One machine, one job
Check the network
Remove OS limitations
Don’t test the client
Overload is not capacity
Thirty Seconds isn’t a test
Do more than Hello world
Not just averages
Publish it all
Try different tools
[from: http://nosql.mypopescu.com/post/5645091912/the-11-commandments-of-benchmarking]
5 tags
Nice Thought on Template Engine →
ถ้าคุณเชื่อในอะไรอย่างหนึ่ง แล้วมีคนบอกว่าคุณเหมาะกับอีกอย่าง
จงอย่าเชื่อ...
– Ochawin
อย่าเสียเวลาไปกับการพูด อธิบาย พรรณา ถ้าสิ่งนั่นไม่ใช่ตัวเรา
จงเดินต่อไป!
– ochawin
2 tags
=== and == in javascript
The 3 equal signs mean “equality without type coersion”. Using the triple equals, the values must be equal in type as well.
0==false // true 0===false // false, because they are of a different type 1==”1” // true, auto type coersion 1===”1” // false, because they are of a different type
Null and Undefined types are == (but not ===).
[from:...
5 tags
sass →
1 tag
In computer systems, a snapshot is the state of a system at a particular point...
– http://en.wikipedia.org/wiki/Snapshot_%28computer_storage%29
2 tags
What is Middleware?
Software that provides a link between separate software applications. Middleware is sometimes called plumbing because it connects two applications and passes data between them. Middleware allows data contained in one database to be accessed through another. This definition would fit enterprise application integration and data integration software. This technology evolved to provide for...
3 tags
Graylog2: MongoDB for Centralizing Logging →
nosql:
Why Graylog2 uses MongoDB:
So we need something in between: schema-less storage with indexes, everything else are bonuses. With Mongo DB we got a lot of them:
capped collections, which preserve insertion order and maximum collection size, automatically removing old messages;
tailed cursors, which are used to implement tail -f behavior;
awesome performance;
and an easy API.
Original...
3 tags
Yeah you're right, they're all facebook stuffs.. →
It’s not important how fast others can run, as the fact that you keep...
– ochawin
5 tags
Install MongoDB 1.6.5 on Fedora 14/13, CentOS 5.5,... →
Simple but useful Mongo tools : http://www.mongodb.org/display/DOCS/Import+Export+Tools#ImportExportTools-SeeAlso
Mongo conf params : http://www.mongodb.org/display/DOCS/File+Based+Configuration
4 tags
MongoDB Map Reduce Tutorials
- MongoDB Tutorial: MapReduce: http://nosql.mypopescu.com/post/394779847/mongodb-tutorial-mapreduce
- Yet another MongoDB Map Reduce tutorial: http://www.mongovue.com/2010/11/03/yet-another-mongodb-map-reduce-tutorial/
3 tags
Node
- What it’s like building a real website in Node.js: http://www.travisglines.com/web-coding/what-its-like-building-a-real-website-in-node-js
- How NodeJS saved my web application: http://rfw.posterous.com/how-nodejs-saved-my-web-application
==========================================
- node.js HTTPS (SSL) Server Example:...
5 tags
The Play framework makes it easier to build Web... →
4 tags
V8: it's behind your Chrome! →
5 tags
Let Gearman schedule your work! →
4 tags
Sinatra is a DSL for quickly creating web... →
2 tags
Making AJAX Applications Crawlable →
3 tags
Protovis : A graphical approach to visualization →
4 tags
Avoid Large Skips
For a large number of results, skip can be slow (this is true in nearly every db) and should be avoided.
Scenario 1: Paginating results without skip
var page1 = db.people.find(criteria).limit(100); var page2 = db.people.find(criteria).skip(100).limit(100);
Solution 1: Calculate the next query based on the result from the previous one.
var latest = null; //first page while(page1.hasNext()){...
5 tags
Best Practices at EBay (Scalability&Architecture) →
6 tags
Vertical and Horizontal Partitioning
The figure shows functional and horizontal partitioning from eBay best practices presentation : http://www.infoq.com/presentations/Best-Practices-eBay
Horizontal partitioning (also see shard) involves putting different rows into different tables. Perhaps customers with ZIP codes less than 50000 are stored in CustomersEast, while customers with ZIP codes greater than or equal to 50000 are...
2 tags
With a normal AND-type query, you want to narrow your results down as far as...
– MongoDB the definitive guide