Opinions are like assholes, every one has got one.
This one is mine.
Punctuation is a bikeshed. Put your semicolons, whitespace, and commas where you like them.
express = require("express") | |
request = require("request") | |
BufferList = require("bufferlist").BufferList | |
app = express.createServer(express.logger(), express.bodyParser()) | |
app.get "/", (req, res) -> | |
if req.param("url") | |
url = unescape(req.param("url")) | |
request | |
uri: url | |
encoding: 'binary' |
{ | |
"color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme", | |
"draw_minimap_border": true, | |
"find_selected_text": true, | |
"font_face": "Bitstream Vera Sans Mono", | |
"font_options": | |
[ | |
"subpixel_antialias", | |
"bold" | |
], |
.bended-shadow { | |
position: relative; | |
width: 500px; | |
margin: 200px auto; | |
} | |
.bended-shadow::before, .bended-shadow::after { | |
content: ''; | |
position: absolute; | |
width: 60%; |
.shadow-stuff { | |
-moz-border-radius: 0% 0% 100% 100% / 0% 0% 8px 8px; | |
-webkit-border-radius: 0% 0% 100% 100% / 0% 0% 8px 8px; | |
border-radius: 0% 0% 100% 100% / 0% 0% 8px 8px; | |
-moz-box-shadow: rgba(0,0,0,.30) 0 2px 3px; | |
-webkit-box-shadow: rgba(0,0,0,.30) 0 2px 3px; | |
box-shadow: rgba(0,0,0,.30) 0 2px 3px; | |
} | |
.container { |
// articles per page | |
var limit = 10; | |
// pagination middleware function sets some | |
// local view variables that any view can use | |
function pagination(req, res, next) { | |
var page = parseInt(req.params.page) || 1, | |
num = page * limit; | |
db.articles.count(function(err, total) { | |
res.local("total", total); |
This is all based on the [alpha release][1].
From the built-in help system:
For many settings TextMate will look for a .tm_properties file in the current folder and in any parent folders (up to the user’s home folder).
These are simple setting = value listings where the value is a format string in which other variables can be referenced.
res.locals.createPagination = function (pages, page) { | |
var url = require('url') | |
, qs = require('querystring') | |
, params = qs.parse(url.parse(req.url).query) | |
, str = '' | |
params.page = 0 | |
var clas = page == 0 ? "active" : "no" | |
str += '<li class="'+clas+'"><a href="?'+qs.stringify(params)+'">First</a></li>' | |
for (var p = 1; p < pages; p++) { |
_.intersectionObjects = _.intersect = function(array) { | |
var slice = Array.prototype.slice; // added this line as a utility | |
var rest = slice.call(arguments, 1); | |
return _.filter(_.uniq(array), function(item) { | |
return _.every(rest, function(other) { | |
//return _.indexOf(other, item) >= 0; | |
return _.any(other, function(element) { return _.isEqual(element, item); }); | |
}); | |
}); |
var zmq = require('zmq') | |
, sock = zmq.socket('push'); | |
sock.bindSync('tcp://127.0.0.1:3000'); | |
console.log('Producer bound to port 3000'); | |
setTimeout(function(){ | |
console.log('sending work'); | |
var data = { |