Skip to content

Instantly share code, notes, and snippets.

View wizardnet972's full-sized avatar
:octocat:
Angularing...

Shlomi Levi wizardnet972

:octocat:
Angularing...
View GitHub Profile
{
"compilerOptions": {
"module": "commonjs",
"sourceMap": true,
"outDir": "../dist/"
},
"exclude": [
"node_modules",
"**/*.spec.ts"
]
{
"name": "hello",
"version": "1.0.0",
"description": "",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [
"hello"
],
#!/usr/bin/env node
require('../dist/index')
class Startup {
public static main(): number {
console.log('Hello World');
return 0;
}
}
Startup.main();
// Place your settings in this file to overwrite the default settings
{
"typescript.check.tscVersion": false,
"files.exclude": {
"**/*.js": {
"when": "$(basename).ts"
},
"**/*.map": {
"when": "$(basename).map"
}
{
"version": "0.1.0",
"command": "tsc",
"isShellCommand": true,
"args": ["-p", "./src"],
"showOutput": "always",
"problemMatcher": "$tsc"
}
@wizardnet972
wizardnet972 / node-cros.js
Created October 30, 2016 17:24
CORS on ExpressJS
app.use(function(req, res, next) {
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
next();
});
app.get('/', function(req, res, next) {
// Handle the get for this route
});
[ngrx] score:-10..0 answers:0 is:q created:1m
function coercing_equal(left, right) {
if (left === right) {
return true ;
}
if (left === null) {
return right === undefined;
}
if (right === null) {
return left === undefined;
}
function new(func, arguments) {
// Create a new object that inherits from the constructor's prototype.
// func is a constructor function.
// arguments is an array of arguments that
// are used to invoke the constructor.
var that = Object.create(func.prototype),
// Invoke the constructor, binding –this- to the new object.