-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
381 lines (206 loc) · 12.1 KB
/
index.html
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
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
<!DOCTYPE html>
<!--[if IEMobile 7 ]><html class="no-js iem7"><![endif]-->
<!--[if lt IE 9]><html class="no-js lte-ie8"><![endif]-->
<!--[if (gt IE 8)|(gt IEMobile 7)|!(IEMobile)|!(IE)]><!--><html class="no-js" lang="en"><!--<![endif]-->
<head>
<meta charset="utf-8">
<title>Nathan Scully</title>
<meta name="author" content="Nathan">
<meta name="description" content="After having a few moments over the last few months of ‘I need to learn something new’ - I have decided to teach myself a new language/ …">
<!-- http://t.co/dKP3o1e -->
<meta name="HandheldFriendly" content="True">
<meta name="MobileOptimized" content="320">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="canonical" href="http://nathanscully.github.com">
<link href="/favicon.png" rel="icon">
<link href="/stylesheets/screen.css" media="screen, projection" rel="stylesheet" type="text/css">
<link href="/atom.xml" rel="alternate" title="Nathan Scully" type="application/atom+xml">
<script src="/javascripts/modernizr-2.0.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script>!window.jQuery && document.write(unescape('%3Cscript src="./javascripts/lib/jquery.min.js"%3E%3C/script%3E'))</script>
<script src="/javascripts/octopress.js" type="text/javascript"></script>
<!--Fonts from Google"s Web font directory at http://google.com/webfonts -->
<link href="http://fonts.googleapis.com/css?family=PT+Serif:regular,italic,bold,bolditalic" rel="stylesheet" type="text/css">
<link href="http://fonts.googleapis.com/css?family=PT+Sans:regular,italic,bold,bolditalic" rel="stylesheet" type="text/css">
</head>
<body >
<header role="banner"><hgroup>
<h1><a href="/">Nathan Scully</a></h1>
<h2>A place for me to not forget things</h2>
</hgroup>
</header>
<nav role="navigation"><ul class="subscription" data-subscription="rss">
<li><a href="/atom.xml" rel="subscribe-rss" title="subscribe via RSS">RSS</a></li>
</ul>
<form action="http://google.com/search" method="get">
<fieldset role="search">
<input type="hidden" name="q" value="site:nathanscully.github.com" />
<input class="search" type="text" name="q" results="0" placeholder="Search"/>
</fieldset>
</form>
<ul class="main-navigation">
<li><a href="/">Blog</a></li>
<li><a href="/blog/archives">Archives</a></li>
</ul>
</nav>
<div id="main">
<div id="content">
<div class="blog-index">
<article>
<header>
<h1 class="entry-title"><a href="/blog/a-new-language/">A New Language</a></h1>
<p class="meta">
<time datetime="2013-03-16T18:00:00+11:00" pubdate data-updated="true">2013-03-16</time>
</p>
</header>
<div class="entry-content"><p>After having a few moments over the last few months of ‘I need to learn something new’ - I have decided to teach myself a new language/technology.</p>
<p>According to the internet I need to be learning… well, I just end up confused. Scala, clojure, ruby(well Ruby On Rails for something useful), javascript, functional, JVM based - it just gets silly. To make life simpler, I bit the bullet and just picked one that sounded interesting and I am going to stick with it and try a few projects. Then pick another and try and recreate the projects or just move onto new ones.</p>
<p>Node.js took my fancy - purely because I have used javascript in the past, I am interested in web applications and it just sounds like a different way of thinking than I am used to. I started a couple of helloworld tutorals and I have decided to stick to it(even though you see posts about [how terrible node.js is(http://dev.hasenj.org/post/31042963934/nodejs-hate)]).</p>
<p>Will it be the language of the future - maybe, javascript is pretty useful across both web and now thanks to node.js, the server. I really want to get into Google’s language <a href="www.golang.org">Go</a> - but that will be later!</p>
</div>
</article>
<article>
<header>
<h1 class="entry-title"><a href="/blog/nodepad-node-dot-js-appliction/">Nodepad - Node.js Appliction</a></h1>
<p class="meta">
<time datetime="2013-03-16T17:51:00+11:00" pubdate data-updated="true">2013-03-16</time>
</p>
</header>
<div class="entry-content"><h2>Introduction:</h2>
<p>With my new motivation(and commitment) to learn Javascript - specifically the <a href="www.nodejs.org">node.js</a> platform I have been hunting for a few tutorials.</p>
<p>After completing some basic helloworld I found <a href="www.dailyjs.com">daily.js</a> and their <a href="http://dailyjs.com/2010/11/01/node-tutorial/">nodepad</a> application.</p>
<p>It was written a few years ago and is now out of date with versions, and likely syntax so I am going to go through the tutorial and write my own version. All credits to dailyjs for the original material.</p>
<p>Nodepad will be a simple web based notepad application built using node.js and taking advantage of the express framework</p>
<h2>Requirements:</h2>
<ul>
<li>Node.js - an obvious requirement!</li>
<li>MongoDB - a NoSQL database thats getting a good wraps across the interwebs</li>
<li>NPM - Node package manager - used to install and manage any additonal packages we require.</li>
</ul>
<h2>Setup:</h2>
<p>Make a new working directory:</p>
<pre><code>mkdir nodepad
</code></pre>
<p>Install express</p>
<pre><code>npm install -g express
</code></pre>
<p>The -g flag installs this globally, allowing us to setup a skeleton application:</p>
<pre><code>express nodepad
</code></pre>
<p>Change into the nodepad directory and install the dependencies</p>
<pre><code>npm install
</code></pre>
<p>Update the package.json to include the required dependencies:</p>
<pre><code>{
"name": "nodepad",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node app"
},
"dependencies": {
"express": "3.1.0",
"jade": "*",
"less": "*",
"expresso": "*",
"mongoose": "*"
}
}
</code></pre>
<p>Run the skeleton application and view it on http://localhost:3000/:</p>
<pre><code>node app.js
</code></pre>
<p>Close the process and then setup a mongodb database:
in a new terminal start the mongodb server:</p>
<pre><code>mongod
</code></pre>
<p>connect via:</p>
<pre><code>mongo
</code></pre>
<p>Create a new nodepad db:</p>
<pre><code>use nodepad
</code></pre>
<h2>Application:</h2>
<p>Setup our first data model - we will use mongoose to wrap a class around our mongodb database. Save the following as models.js in the root of the nodepad folder.</p>
<pre><code>var mongoose = require('mongoose');
mongoose.model('Document', {
properties: ['title', 'data', 'tags'],
indexes: [
'title'
]
});
exports.Document = function(db) {
return db.model('Document');
};
</code></pre>
<p>We can now use the model via the following in our app.js file:</p>
<pre><code>db = mongoose.connect('mongodb://localhost/nodepad')
Document = require('./models.js').Document(db);
</code></pre>
<p>Be sure to add the mongoose dependency to the list of required modules:</p>
<pre><code>mongoose = require('mongoose');
</code></pre>
<p>Add the following config to our app.js. This will enable us to use less to complie our css</p>
<pre><code>app.configure(function(){
...
app.use(express.compiler({ src : __dirname + '/public', enable: ['less']}));
});
</code></pre>
<p>This completes the basic setup of our application. The next post will develop the application futher.</p>
</div>
</article>
<article>
<header>
<h1 class="entry-title"><a href="/blog/and-so-it-beings/">And So It Beings</a></h1>
<p class="meta">
<time datetime="2013-03-16T15:15:00+11:00" pubdate data-updated="true">2013-03-16</time>
</p>
</header>
<div class="entry-content"><p>I have been thinking about writing for a while. By ‘writing’ I mean dumping my thoughts and what I have been doing whilst consuming time.</p>
<p>This is a bit of a motivational project, self improvement even. I am dyslexic, so the thought of writing large chunks of text general makes me uncomfortable. But the more I write the better I get and the more succinct I am in conveying my thoughts.</p>
<p>I also am a scatter brain. I can focus and work for hours on end and forget what I started out trying to accomplish. The worst is when I work on something and find a useful tidbit of information that I want to reuse 3 months later but can’t for the life of me remember. This blog will server as a purpose to document and mamange my tidbits, and for me to have something to show myself what I have been working on. I think everyone needs to remind themsevles what they have accomplished - it is easy to only see what you havent finished, or even started.</p>
<p>Who am I? A 24 year old from Sydney, Australia. I studied Design Computing with the hopes of becoming an intermediary between Creative and Technical people. A sort of translator between someone who speaks colours and someone who speaks code. For the last 3 years I have been working for a small IT Consultancy company that develops and integrates software and systems around telecommunications and Contact Centres / Call Centres. My role is as a Application Designer/ Voice Consultant/Software Developer/SysAdmin/PreSales/Project Manager - basically just what needs to be done on the day. 90% of my work is developing IVRs(Interactive Voice Response) - Those hated telephone systems that ask you to press 1, press 2 or say what you want. The beauty of the IVRs I develop is that I have full end to end control of the scope, design, development, deployment and maintaince. You learn alot, and very very quickly.</p>
<p>I code in Java, I know - how uncool… Java does what I want it to do, all my clients are large enterprises (Banks generally) so Java plays very nice with their systems. But it is bloated, and the more I play with other languages(Scala/Javascript/Node.js/Rails/Ruby), I am realising there is so much more out there. I have experience in web lanaguages but I am starting to branch out and learn new things. All these languages/technologies are all getting me excited about creating things for myself, not just for a client.</p>
<p>I have set this blog up using <a href="www.octopress.org">Octopress</a>. This is a blog framework for <a href="http://github.com/mojombo/jekyll">Jekyll</a>. So far I love the concept - get rid of the web front end and silly post creation interfaces and just type the post in a text editor of choice. All this is pushed up to github which saves me worring about keeping me a copy and finding hosting.</p>
<p>I am hoping this easy format will encourage me to keep writing. I am going to start simple and document some tutorials and projects i will be working on. My goal is to really force myself to partake in ‘weekend’ projects - little apps that I can knock up in a few days.</p>
<p>And so it begins…</p>
</div>
</article>
<div class="pagination">
<a href="/blog/archives">Blog Archives</a>
</div>
</div>
<aside class="sidebar">
<section>
<h1>Recent Posts</h1>
<ul id="recent_posts">
<li class="post">
<a href="/blog/a-new-language/">A new language</a>
</li>
<li class="post">
<a href="/blog/nodepad-node-dot-js-appliction/">Nodepad - Node.js Appliction</a>
</li>
<li class="post">
<a href="/blog/and-so-it-beings/">And so it beings</a>
</li>
</ul>
</section>
</aside>
</div>
</div>
<footer role="contentinfo"><p>
Copyright © 2013 - Nathan -
<span class="credit">Powered by <a href="http://octopress.org">Octopress</a></span>
</p>
</footer>
<script type="text/javascript">
(function(){
var twitterWidgets = document.createElement('script');
twitterWidgets.type = 'text/javascript';
twitterWidgets.async = true;
twitterWidgets.src = 'http://platform.twitter.com/widgets.js';
document.getElementsByTagName('head')[0].appendChild(twitterWidgets);
})();
</script>
</body>
</html>