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
var score_poker_hand = (function () {
// This program creates and uses two enumeration objects:
// rank_value and score_prefix.
// The score_poker_hand function takes a hand (an array of cards). The hand
// can contain between 5 and 9 cards, within which it will find the best five
// card poker hand. A hand is an array of objects containing rank and suit
// properties. The order of the cards is not significant. The hand is not
// modified.
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.
function coercing_equal(left, right) {
if (left === right) {
return true ;
}
if (left === null) {
return right === undefined;
}
if (right === null) {
return left === undefined;
}
[ngrx] score:-10..0 answers:0 is:q created:1m
@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
});
{
"version": "0.1.0",
"command": "tsc",
"isShellCommand": true,
"args": ["-p", "./src"],
"showOutput": "always",
"problemMatcher": "$tsc"
}
// 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"
}
class Startup {
public static main(): number {
console.log('Hello World');
return 0;
}
}
Startup.main();
#!/usr/bin/env node
require('../dist/index')
{
"name": "hello",
"version": "1.0.0",
"description": "",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [
"hello"
],