To generate your dhparam.pem file, run in the terminal
$ openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
// for demo: http://jsbin.com/jeqesisa/7/edit | |
// for detailed comments, see my SO answer here http://stackoverflow.com/questions/8853396/logical-operator-in-a-handlebars-js-if-conditional/21915381#21915381 | |
/* a helper to execute an IF statement with any expression | |
USAGE: | |
-- Yes you NEED to properly escape the string literals, or just alternate single and double quotes | |
-- to access any global function or property you should use window.functionName() instead of just functionName() | |
-- this example assumes you passed this context to your handlebars template( {name: 'Sam', age: '20' } ), notice age is a string, just for so I can demo parseInt later | |
<p> | |
{{#xif " this.name == 'Sam' && this.age === '12' " }} |
Hello,
If you reached this page, means you've hit this SSL error when trying to pull updates from RubyGems:
SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
This error is produced by changes in rubygems.org infrastructure, please
// http://www.geedew.com/remove-a-directory-that-is-not-empty-in-nodejs/ | |
var fs = require('fs'); | |
var rmdirAsync = function(path, callback) { | |
fs.readdir(path, function(err, files) { | |
if (err) { | |
// Pass the error on to callback | |
callback(err, []); | |
return; |
require(['app'], function (App) { | |
App.init(); | |
}); | |
//app.js | |
define([ | |
'pages' | |
], function (pages) { | |
return { | |
init : function () { |
<!doctype html> | |
<html ng-app="project"> | |
<head> | |
<title>Angular: Service example</title> | |
<script src="http://code.angularjs.org/angular-1.0.1.js"></script> | |
<script> | |
var projectModule = angular.module('project',[]); | |
projectModule.factory('theService', function() { | |
return { |
{ | |
// http://eslint.org/docs/rules/ | |
"ecmaFeatures": { | |
"binaryLiterals": false, // enable binary literals | |
"blockBindings": false, // enable let and const (aka block bindings) | |
"defaultParams": false, // enable default function parameters | |
"forOf": false, // enable for-of loops | |
"generators": false, // enable generators | |
"objectLiteralComputedProperties": false, // enable computed object literal property names |
{ | |
// http://eslint.org/docs/rules/ | |
"ecmaFeatures": { | |
"arrowFunctions": false, // enable arrow functions | |
"binaryLiterals": false, // enable binary literals | |
"blockBindings": false, // enable let and const (aka block bindings) | |
"classes": false, // enable classes | |
"defaultParams": false, // enable default function parameters | |
"destructuring": false, // enable destructuring |
var tar = require('tar-fs'); | |
var zlib = require('zlib'); | |
function transferDir(conn, remotePath, localPath, compression, cb) { | |
var cmd = 'tar cf - "' + remotePath + '" 2>/dev/null'; | |
if (typeof compression === 'function') | |
cb = compression; | |
else if (compression === true) | |
compression = 6; |
'use strict'; | |
var gulp = require('gulp'); | |
var del = require('del'); | |
var mocha = require('gulp-mocha-co'); | |
var istanbul = require('gulp-istanbul'); | |
var isparta = require('isparta'); | |
var coverageEnforcer = require('gulp-istanbul-enforcer'); | |
var paths = { | |
server: { |