This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<filter> | |
<filter-name>CorsFilter</filter-name> | |
<filter-class>org.apache.catalina.filters.CorsFilter</filter-class> | |
<init-param> | |
<param-name>cors.allowed.origins</param-name> | |
<param-value>*</param-value> | |
</init-param> | |
<init-param> | |
<param-name>cors.allowed.methods</param-name> | |
<param-value>GET,POST,HEAD,OPTIONS,PUT</param-value> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"sass.options": { | |
"outputDir": "../styles" | |
}, | |
"linting.enabled": true, | |
"language": { | |
"javascript": { | |
"linting.prefer": "JSHint", | |
"linting.usePreferredOnly": true | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//convert a string to number | |
+'2' //2 | |
+'2a' //NaN | |
//convert anything to boolean | |
!!'it will be converted to true' //true | |
!!'' //false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// print process.argv | |
process.argv.forEach(function(val, index, array) { | |
console.log(index + ': ' + val); | |
}); | |
//$ node process.js one two=three four | |
//0: node | |
//1: /Users/mjr/work/node/process-2.js | |
//2: one | |
//3: two=three |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var page = require('webpage').create(); | |
page.open('http://edysegura.com', function () { | |
var title = page.evaluate(function () { | |
return document.title; | |
}); | |
page.clipRect = { top: 0, left: 0, width: 600, height: 700 }; | |
page.render(title + ".png"); | |
phantom.exit(); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var MathService = { | |
add: function() { | |
var amount = arguments.length; | |
var total = 0; | |
if(amount > 0) { | |
for(var i=0; i<amount; i++) { | |
var currentNumber = parseInt(arguments[i], 10); | |
if(isNaN(currentNumber)) return null; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function random(seed) { | |
if (!seed) | |
seed = new Date().getTime(); | |
seed = (seed*9301+49297) % 233280; | |
return seed/(233280.0) * 100; | |
} | |
function seed() { | |
var seedNumber = (Math.random() * Math.pow(10, 17) + Math.random() * Math.pow(10, 17) + Math.random() * Math.pow(10, 17) + Math.random() * Math.pow(10, 17)); | |
return seedNumber; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.no-selection { | |
-webkit-user-select: none; | |
-moz-user-select: none; | |
-ms-user-select: none; | |
user-select: none; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find | |
^(\s+)?< | |
replace | |
$1'< | |
find | |
>$ | |
replace |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Intercepting HTTP calls with AngularJS. | |
angular.module('MyApp', []) | |
.config(function ($provide, $httpProvider) { | |
// Intercept http calls. | |
$provide.factory('MyHttpInterceptor', function ($q) { | |
return { | |
// On request success | |
request: function (config) { | |
// console.log(config); // Contains the data about the request before it is sent. |