Use this method when viewing images or textual data. It allows you to open it in a seperate window. This will cause a popup blocker to react.
window.open(url,'_blank');
'use strict'; | |
var gm = require('gm'); | |
var glob = require('glob'); | |
var async = require('async'); | |
var uuid = require('node-uuid'); | |
var join = require('path').join; | |
var r1 = /(?!\n)\W/ig; | |
var r2 = /\s{1,}/ig; | |
function slugify(str){ | |
return String(str).replace(r1, ' ').replace(r2, '-').toLowerCase().trim(); | |
} |
def smallest(x, y, z): | |
""" | |
put a set of numbers in an array | |
sort them least to greatest | |
return the first element in the array to get the smallest | |
""" | |
nums = [x, y, z] | |
nums.sort() | |
return nums[0] |
function CSV(){ | |
this.headers = []; | |
this.headersWriten = false; | |
this.delimiter = ','; | |
this.write = print || console.log; | |
this.print = function (row){ | |
if (this.headersWriten === false) { | |
this.headers = Object.keys(row); |
I hereby claim:
To claim this, I am signing this object:
# set your nginx config to route wild cards | |
server_name *.domain.com; | |
# if you dont want to use nginx you can test by modifying you host file | |
sudo nano -w /private/etc/hosts | |
# add line | |
127.0.0.1 testing.expresshost.com | |
# Then open http://testing.expresshost.com:3080 | |
# and you should see the subdomain in the response |
type Whatever struct { | |
someField int | |
} | |
func (w Whatever) MarshalJSON() ([]byte, error) { | |
return json.Marshal(struct{ | |
SomeField int `json:"some_field"` | |
}{ | |
SomeField: w.someField, | |
}) |
# to generate your dhparam.pem file, run in the terminal | |
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |