Skip to content

Instantly share code, notes, and snippets.

tmp node tmp.js
3 Aug 13:05:57 - ---DOM created
3 Aug 13:05:57 - 0 seconds [Remove all stylesheets]
3 Aug 13:05:57 - 0 seconds [Turn all double br's into p's]
3 Aug 13:05:57 - 0.007 seconds [prepDocument]
3 Aug 13:05:57 - 0.712 seconds [grabArticle nodePrepping]
3 Aug 13:05:57 - 0.01 seconds [grabArticle calculate scores]
3 Aug 13:05:57 - 0.022 seconds [grabArticle find top candidate]
3 Aug 13:05:57 - 0.015 seconds [grabArticle look through its siblings]
3 Aug 13:05:57 - 0.002 seconds [cleanConditionally]
var fs = require('fs');
var readability = require('readability');
var html = fs.readFileSync('test.html', 'utf-8');
// This is an very early example. The API is subject to change.
readability.parse(html, 'http://www.cnn.com/2013/08/01/politics/congress-work-time/index.html?hpt=hp_t1', function(result) {
console.log(JSON.stringify(result, null, 4));
});
@zdwolfe
zdwolfe / gist:6690401
Created September 24, 2013 20:00
LibreCMS Model Construction
[
{
"model": "User",
"type": [String],
"username": String,
"courses": [Course],
"authentication": {
"pasword": SHAEncodedString,
"accessTokens": [String]
}
@zdwolfe
zdwolfe / gist:6721115
Last active October 1, 2018 06:38
Basic nginx configuration for AngularJS html5Mode
server {
listen 0.0.0.0:12345;
location / {
root /home/zdwolfe/src/angularAWS/app;
try_files $uri $uri/ /index.html =404;
}
}
user.js:
'use strict';
angular.module('myApp')
.controller('UserCtrl', function ($scope, Restangular) {
$scope.users = Restangular.all('user').getList();
});
function sayHello() {
console.log('hello ');
}
process.nextTick(sayHello);
console.log('world!');
'use strict';
describe('Controller: ContentCtrl', function () {
// load the controller's module
beforeEach(module('myApp'));
var ContentCtrl, scope, state, q;
// Initialize the controller and a mock scope
'use strict';
describe('Controller: CourseCtrl', function () {
// load the controller's module
beforeEach(module('myApp'));
var CourseCtrl,
scope;
'use strict';
describe('Controller: CourseCtrl', function () {
// load the controller's module
beforeEach(module('myApp'));
// load controller widgets/views/partials
var views = [
'views/course.html',
module.exports = function(config) {
'use strict';
config.set({
basePath: '',
frameworks: ['jasmine'],
files: [
'app/bower_components/angular/angular.js',
'app/bower_components/angular-mocks/angular-mocks.js',
'app/scripts/*.js',
'app/scripts/**/*.js',