| # @brief | |
| # Performs file upload validation for django. The original version implemented | |
| # by dokterbob had some problems with determining the correct mimetype and | |
| # determining the size of the file uploaded (at least within my Django application | |
| # that is). | |
| # @author dokterbob | |
| # @author jrosebr1 | |
| import mimetypes |
| class MyClass { | |
| static final MyClass _singleton = new MyClass._internal(); | |
| factory MyClass() { | |
| return _singleton; | |
| } | |
| MyClass._internal() { | |
| ... // initialization logic here | |
| } |
| var middleware = require('middleware'), // the Middleware you want to test | |
| httpMocks = require('node-mocks-http'), // quickly sets up REQUEST and RESPONSE to be passed into Express Middleware | |
| request = {}, // define REQUEST | |
| response = {} // define RESPONSE | |
| ; | |
| describe('Middleware test', function(){ | |
| context('Valid arguments are passed', function() { | |
| beforeEach(function(done) { | |
| /* |
To copy database from one heroku app to another -
heroku pg:backups capture [database_name]
heroku pg:backups restore $(heroku pg:backups public-url --app source_app) DATABASE_URL --app target_app
You can refer to https://devcenter.heroku.com/articles/heroku-postgres-backups for more information.
To copy database from local to heroku -
Dump your local database in compressed format using the open source pg_dump tool: PGPASSWORD=mypassword pg_dump -Fc --no-acl --no-owner -h localhost -U myuser mydb > mydb.dump
where myuser is your database username and mydb is the database name.
I work as a full-stack developer at work. We are a Windows & Azure shop, so we are using Windows as our development platform, hence this customization.
For my console needs, I am using Cmder which is based on ConEmu with PowerShell as my shell of choice.
Yes, yes, I know nowadays you can use the Linux subsystem on Windows 10 which allow you to run Ubuntu on Windows. If you are looking for customization of the Ubuntu bash shell, check out this article by Scott Hanselman.
| // Given 5 Points | |
| const coordsA = [ | |
| {x: 589.4542, y: 1250.2301}, | |
| {x: 682.36816, y: 487.62726}, | |
| {x: 904.16284, y: 836.44556}, | |
| {x: 373.65402, y: 839.444}, | |
| {x: 724.32935, y: 710.51117} | |
| ] | |
| // Get SSS Of Triangle |