npm install package --save
will auto add to dependencies- Use an MVC structure
- You can have dependencies just for development
- There are a few higher level frameworks (Tower.js, Geddy, Derby, Locomotive.js) but it seems wise to keep it simple
- Use an MVC structure
- The power of node modules cannot be understated. On the other hand it seems best to limit as much as possible to only required modules
- Get your code clearly organized from the start
- Use an MVC structure
This file contains 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
import com.twitter.finagle.http.path._ | |
import com.twitter.finagle.http.service.RoutingService | |
import com.twitter.finagle.http.{Request, Response, RichHttp, Http} | |
import com.twitter.finagle.{Service, SimpleFilter} | |
import org.jboss.netty.handler.codec.http._ | |
import org.jboss.netty.handler.codec.http.HttpResponseStatus._ | |
import org.jboss.netty.handler.codec.http.HttpVersion.HTTP_1_1 | |
import org.jboss.netty.buffer.ChannelBuffers.copiedBuffer | |
import org.jboss.netty.util.CharsetUtil.UTF_8 | |
import com.twitter.util.Future |
This file contains 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
# Most part of this file is created by https://www.gitignore.io | |
### Node ### | |
# Logs | |
logs | |
*.log | |
# Runtime data | |
pids | |
*.pid |
This file contains 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
<scheme name="Molokai" version="142" parent_scheme="Default"> | |
<option name="LINE_SPACING" value="1.0" /> | |
<option name="EDITOR_FONT_SIZE" value="14" /> | |
<option name="EDITOR_FONT_NAME" value="Menlo" /> | |
<colors> | |
<option name="ADDED_LINES_COLOR" value="a6e22e" /> | |
<option name="ANNOTATIONS_COLOR" value="66d9ef" /> | |
<option name="ANNOTATIONS_MERGED_COLOR" value="a6e22e" /> | |
<option name="CARET_COLOR" value="f8f8f2" /> | |
<option name="CARET_ROW_COLOR" value="232526" /> |
This file contains 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
#!/bin/bash | |
# Chrome Refresh | |
# | |
# nik cubrilovic - nikcub.appspot.com | |
# | |
# Simple applescript browser reloader for Google Chrome. It will either open a | |
# new tab with the url passed in as an argument or refresh an existing tab. | |
# | |
# Link this up with watchr to auto-refresh browser windows when you save files |
This file contains 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
<?php | |
/* html_convert_entities($string) -- convert named HTML entities to | |
* XML-compatible numeric entities. | |
*/ | |
function html_convert_entities($string) { | |
return preg_replace_callback('/&([a-zA-Z][a-zA-Z0-9]+);/S', | |
'convert_entity', $string); | |
} |
This file contains 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
/* | |
* File: bst.js | |
* | |
* A pure JavaScript implementation of a binary search tree. | |
* | |
*/ | |
/* | |
* Class: BST | |
* |
FileMerge (opendiff) can really come in handy when you need to visually compare merging conflicts. Other times it's just a nice visual way to review your days work.
The following method works by creating a simple bash script (git-diff-cmd.sh) that sets us up with the proper command line arguments for Git to pass off files to FileMerge.
Using default OSX apache httpd to serve ~/Sites/foo at http://foo.local
By configuring dns and using virtual hosts - you can automatically serve folders in your ~/Sites directory under a local domain.
Wildcard DNS is a better option that editing your /etc/hosts file for every site, there are a few ways to do this.
http://mikeferrier.com/2011/04/04/setting-up-wildcard-dns-on-localhost-domains-on-osx/
OlderNewer