var express = require('express'); | |
var sys = require('sys'); | |
var oauth = require('oauth'); | |
var app = express.createServer(); | |
var _twitterConsumerKey = "YOURTWITTERCONSUMERKEY"; | |
var _twitterConsumerSecret = "YOURTWITTERCONSUMERSECRET"; | |
function consumer() { |
express = require 'express' | |
app = module.exports = express.createServer() | |
# redirect to a non-www domain | |
app.get '/*', (req, res, next) -> | |
if req.headers.host.match(/^www\./)? | |
res.redirect 'http://' + req.headers.host[4..] + req.url, 301 | |
else next() |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2015 Larry Fox <http://larryfox.us> | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
app.configure(function () { | |
app.set('views', __dirname + '/views'); | |
app.set('view engine', 'ejs'); | |
app.use(express.bodyParser()); | |
app.use(express.methodOverride()); | |
app.use(express.cookieParser()); | |
app.configure('production', function () { | |
app.use (function (req, res, next) { | |
var schema = (req.headers['x-forwarded-proto'] || '').toLowerCase(); | |
if (schema === 'https') { |
cheerio = require('cheerio') | |
Shred = require('shred') | |
shred = new Shred() | |
http = require('http') | |
URL = require('url') | |
server = http.createServer (request, response) -> | |
url = URL.parse(request.url, true) | |
urlToDiscover = url.query['url'] | |
startDiscovery urlToDiscover, (theImageURL) -> |
I'm having trouble understanding the benefit of require.js. Can you help me out? I imagine other developers have a similar interest.
From Require.js - Why AMD:
The AMD format comes from wanting a module format that was better than today's "write a bunch of script tags with implicit dependencies that you have to manually order"
I don't quite understand why this methodology is so bad. The difficult part is that you have to manually order dependencies. But the benefit is that you don't have an additional layer of abstraction.
Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.
Most workflows make the following compromises:
-
Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the
secure
flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection. -
Use production SSL certificates locally. This is annoying
(function () { | |
d3.analog= function() { | |
var height = 100, gap=10, | |
xValue = function(d) { return d[0]; }, | |
xScale = null, | |
color = d3.scale.category10(); | |
function chart(selection) { | |
selection.each(function(d) { | |
var g = d3.select(this); |