Skip to content

Instantly share code, notes, and snippets.

View bryanforbes's full-sized avatar

Bryan Forbes bryanforbes

View GitHub Profile
export function hidden(target: Object, key: string): void {
// Define a non-enumerable property on the prototype
Object.defineProperty(target, key, {
enumerable: false,
set: function (value) {
// The first time the property is set on an instance, define a non-enumerable property on the instance
Object.defineProperty(this, key, {
enumerable: false,
writable: true,
var __decorate = this.__decorate || function (decorators, target, key, desc) {
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
switch (arguments.length) {
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
}
};
function enumerable(enumerable) {
if (enumerable === void 0) { enumerable = true; }
function MyPromise(executor) {
Promise.call(this, executor);
}
MyPromise.prototype = Object.create(Promise.prototype);
MyPromise.prototype.constructor = MyPromise;
var p = new MyPromise(function () {});
var gulp = require('gulp');
var filter = require('gulp-filter');
var vinylPaths = require('vinyl-paths');
var fs = require('fs');
gulp.task('clean', function (cb) {
var vp = vinylPaths();
gulp.src([ '**/{*.js,*.js.map}', '!node_modules/**/*' ], { read: false })
.pipe(filter(function (file) {
var jsName = file.path.match(/(.*\.js)(?:\.map)?$/)[1];

GitLab CE Omnibus installation using system nginx

Requirements

  • Ubuntu 14.04 LTS
  • Root or sudo access

Steps

  • Install git and nginx:

Postfix Hardening for MX Guarddog

For this guide, the following assumptions are made:

  • MX Guarddog is being used to filter spam
  • MX records have been set to MX Guarddog's servers
  • Postfix successfully receives and delivers mail from MX Guarddog's servers

After following the instructions at MX Guarddog for setting up the MX records, email addresses, email server, and quarantine reports, everything should Just Work™. Spam should slow to a trickle; MX Guarddog does a really good job of spam filtering! The only thing they can't protect against is spammers that ignore the MX records of a server and try to connect directly to the server. For that, some configuration will need to be done. In addition to this, we'll also prevent submitting email on port 25 and only allow it on the submission port (587).

require([
'dojo/request',
], function (request) {
request.post('http://whocares.com/payment', {
data: JSON.stringify({
cardNumber: 111111111111,
expirationDate: Infinity,
transferAmount: '11000000000.00'
})
});
{
"requireCurlyBraces": [
"if", "else", "for", "while", "do", "try",
"catch"
],
"requireSpaceAfterKeywords": [
"if", "else", "for", "while", "do", "switch",
"return", "try", "catch"
],
"requireSpaceBeforeBlockStatements": true,
/**
* @module my/module2
*/
define([], function () {
/**
* @alias module:my/module2
*/
return {
/**
* A description of the following function
/**
* @module my/module2
*/
define([], function () {
/**
* @alias module:my/module2
*/
var module2 = {
/**
* A description of the following function