- There are some situations that are difficult to distinguish mechanically, so I now consider all of those cases problematic, even when they are not obviously wrong.
- You should be coding for readability and error resistance.
- The place to express yourself in programming is in the quality of your ideas, and the efficiency of execution. The role of style is the same as in literature. A great writer doesn't express himself by putting the spaces before his commas instead of after, or by putting extra spaces inside his parentheses.
- Many people think they have good reasons for doing things badly.
- [The purpose of JSLint is not to make you feel good about inadequate coding standards.](http://tech.groups.y
(defun sort-lines-by-length (b e) | |
(interactive "r") | |
(save-excursion | |
(save-restriction | |
(narrow-to-region b e) | |
(let ((items (sort | |
(split-string | |
(buffer-substring (point-min) (point-max)) "[\n]") | |
(lambda(x y) (< (length x) (length y))))) | |
) |
"These long lists of random actors must continue until their plurality and autonomy is no longer suppressed. We still know nothing about these objects or what they entail. All that is clear is their metaphysical equality. The world is a stage filled with actors; philosophy is object-oriented philosophy." — Harman, Prince of Networks.
"[These lists are] a repeated sorcerer’s chant of the multitude of things that resist any unified empire." — Harman, Prince of Networks
-
lactc acid ferment
-
city of Rouen
-
the laboratory on the Rue d’Ulm
-
God
Node.js core does its best to treat every platform equally. Even if most Node developers use OS X day to day, some use Windows, and most everyone deploys to Linux or Solaris. So it's important to keep your code portable between platforms, whether you're writing a library or an application.
Predictably, most cross-platform issues come from Windows. Things just work differently there! But if you're careful, and follow some simple best practices, your code can run just as well on Windows systems.
On Windows, paths are constructed with backslashes instead of forward slashes. So if you do your directory manipulation
(add-to-list 'auto-mode-alist '("\\.js$" . js2-mode)) | |
(add-to-list 'auto-mode-alist '("\\.json$" . js2-mode)) | |
;; Use js-mode indentation in js2-mode, I don't like js2-mode's indentation | |
;; | |
;; thanks http://mihai.bazon.net/projects/editing-javascript-with-emacs-js2-mode | |
;; with my own modifications | |
;; | |
(defun my-js2-indent-function () |
# A module to handle fetching, parsing, and displaying the short urls data and | |
# to handle loading the long url baed on the passed in hash tag. | |
# | |
# When this is executed on a page it will load the data from a JSON file. It | |
# the checks if there is a hash tag in the URL. If so it redirects the page to | |
# the long url. If not it lists out all the short urls. | |
# | |
# For example, `http://mysite.com/s/` will display the list and | |
# `http://mysite.com/s/#1` will redirect to the associated url for the id 1. | |
# |
# Git commands | |
# ggh - git url: get the url to the current github repo (assumes it's the remote push server) | |
# ggbn - git branch name: get the name of the current branch | |
# ggwip - git wip: commit the current staged and unstaged files with a commit message of WIP | |
# ggundo - git undo: pull the last commit off as staged changes | |
# ggbh - git branch history: list the 6 recent branches by commit date | |
# ggbs - git branch smart history: list the 6 recent branches by commit date without master, staging or production | |
# ggbl - git branch last: get the last branch that is not master, staging or production | |
alias ggh="git remote -v 2> /dev/null | grep push | awk '{print \$2}' | sed 's/:/\//' | sed 's/git@\(.*\)\.git/https:\/\/\1/'" |
#Node - Build Automation
##Setup
Jake is the JavaScript equivilent of the Ruby Rake tool. It prefers to be installed globally but for build purposes it is better to install it into node_modules. For more info see http://howtonode.org/intro-to-jake
npm install jake
module.exports = function(grunt) { | |
grunt.initConfig({ | |
pkg: grunt.file.readJSON('package.json'), | |
browserify: { | |
dist: { | |
files: { | |
'build/module.js': ['js/**/*.js'] | |
} | |
} |