Skip to content

Instantly share code, notes, and snippets.

View nborwankar's full-sized avatar

Nitin Borwankar nborwankar

View GitHub Profile
(function(name, container){
var index=10;
function log(){
console.log(index);
}
function iterate(){
var Person = function(name){
this.name = name;
Person.prototype.getName = function(){ return this.name};
}
var thomas = new Person('Thomas');
var amy = new Person('Amy');
// just got # 2 so far
// can do number 3 by removing first two handlers but apparently thats not what you want
<div id="the_div">
<ul id="the_list">
<li id="the_item">Click me!</li>
</ul>
</div>
@nborwankar
nborwankar / nitin_jchris_evently_chat
Created August 13, 2010 01:45
Transcript of skype chat between Nitin Borwankar and J Chris Anderson
Nitin Borwankar: So big picture question that helps me understand why I should spend time grokking evently - two part question
Nitin Borwankar: a) why did you feel the need to create yet another framework b) what can I do with evently I couldn't do with
jQuery events etc?
Chris Anderson: evently was a natural consequence of using jquery
Chris Anderson: it just wraps up all the repetitive crap I kept doing in jquery, and does it automatically
Chris Anderson: so b) nothing
Nitin Borwankar: ok cool
Nitin Borwankar: second q
Chris Anderson: I think evently was discovered not invented
Nitin Borwankar: what are the component files of an evently minimal app (there's too much in a couchapp to tell what's essential
<html lang="en">
<head>
<title>Couch View</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" src="jquery.couch-view.js"></script>
<script>
$(document).ready(function() {
$(".grid-test").couchview({
url: "http://69.164.211.38:8080/mydb/_design/tests/_view/",
<table id="table-1" bgcolor="gray">
<thead>
<tr bgcolor="lightgray">
<th>Id</th>
<th>Date</th>
<th>Hour</th>
<th>Load</th>
</tr>
</thead>
<tbody>
<table id="example-1" bgcolor="gray" class="grid-test">
<thead>
<tr bgcolor="lightgray" class="header-row">
<th>Id</th>
<th>Date</th>
<th>Hour</th>
<th>Load</th>
</tr>
</thead>
<tbody class="data-body">
<tfoot>
<tr bgcolor="white">
<th ><button class="pager-prev-page">prev</button></th>
<th colspan="2"><span class="pager-page"></span>
of <span class="pager-page-total"></span></th>
<th ><button class="pager-next-page">next</button></th>
</tr>
</tfoot>
; <<>> DiG 9.6.0-APPLE-P2 <<>> registry.npmjs.org a
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 12756
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 4, ADDITIONAL: 0
;; QUESTION SECTION:
;registry.npmjs.org. IN A
;; ANSWER SECTION:
npm it worked if it ends with ok
npm configfile /Users/nitin/.npmrc
npm cli [ 'install', 'websocket' ]
npm version 0.1.20
npm install pkg websocket
npm fetch data websocket
npm GET websocket
npm ! Error: ECONNREFUSED, Connection refused
at IOWatcher.callback (net:854:22)