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
yarn add -D jest babel-jest babel-preset-es2015 babel-preset-react react-test-renderer | |
#Edit package.json adding the jest command : | |
"scripts": { | |
"build": "nwb build-react-component", | |
"clean": "nwb clean-module && npm clean-demo", | |
"start": "nwb serve-react-demo", | |
"test": "nwb test", | |
"test:coverage": "nwb test --coverage", | |
"test:watch": "nwb test --server", | |
"test:jest": "jest" |
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 HTML POST data or HTTP GET query string to JSON | |
## get the raw post data from the AWS built-in variable and give it a nicer name | |
#if ($context.httpMethod == "POST") | |
#set($rawAPIData = $input.path("$")) | |
#elseif ($context.httpMethod == "GET") | |
#set($rawAPIData = $input.params().querystring) | |
#set($rawAPIData = $rawAPIData.toString()) | |
#set($rawAPIDataLength = $rawAPIData.length() - 1) | |
#set($rawAPIData = $rawAPIData.substring(1, $rawAPIDataLength)) |
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
app.config(function($compileProvider) { | |
if (!location.host.match(/localhost/)) { | |
$compileProvider.debugInfoEnabled(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
Vagrant::Config.run do |config| | |
config.vm.box = "centos-63-x64" | |
config.vm.share_folder "PuppetFiles", "/etc/puppet/files", "./files" | |
config.vm.define :redis_server do |redis_server| | |
redis_server.vm.network :hostonly, "192.168.0.10" | |
redis_server.vm.provision :puppet do |puppet| | |
puppet.manifest_file = "redis_server_manifest.pp" | |
puppet.options = ["--fileserverconfig=/vagrant/fileserver.conf"] |
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
// convenient Spring JDBC RowMapper for when you want the flexibility of Jackson's TreeModel API | |
// Note: Jackson can also serialize standard Java Collections (Maps and Lists) to JSON: if you don't need JsonNode, | |
// it's simpler and more portable to have Spring JDBC simply return a Map or List<Map>. | |
package org.springframework.jdbc.core; | |
import java.math.BigDecimal; | |
import java.sql.ResultSet; | |
import java.sql.ResultSetMetaData; | |
import java.sql.SQLException; |
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 retry { | |
local retry_max=$1 | |
shift | |
local count=$retry_max | |
while [ $count -gt 0 ]; do | |
"$@" && break | |
count=$(($count - 1)) | |
sleep 1 | |
done |