#!/bin/sh | |
# Just copy and paste the lines below (all at once, it won't work line by line!) | |
# MAKE SURE YOU ARE HAPPY WITH WHAT IT DOES FIRST! THERE IS NO WARRANTY! | |
function abort { | |
echo "$1" | |
exit 1 | |
} | |
set -e |
/** | |
* Module dependencies. | |
*/ | |
var express = require('express') | |
, routes = require('./routes') | |
, http = require('http') | |
, mongoose = require('mongoose') | |
, path = require('path'); |
module.exports = { | |
deleteObject: function (client, deleteParams) { | |
client.deleteObject(deleteParams, function (err, data) { | |
if (err) { | |
console.log("delete err " + deleteParams.Key); | |
} else { | |
console.log("deleted " + deleteParams.Key); | |
} | |
}); | |
}, |
#!/bin/bash | |
### USAGE | |
### | |
### ./ElasticSearch.sh 1.7 will install Elasticsearch 1.7 | |
### ./ElasticSearch.sh will fail because no version was specified (exit code 1) | |
### | |
### CLI options Contributed by @janpieper | |
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch |
React Component Lifecycle
var Excel = require('exceljs'); | |
// create workbook & add worksheet | |
var workbook = new Excel.Workbook(); | |
var worksheet = workbook.addWorksheet('Discography'); | |
// add column headers | |
worksheet.columns = [ | |
{ header: 'Album', key: 'album'}, | |
{ header: 'Year', key: 'year'} |
import AsyncComponent from './path/to/component'; | |
import request from 'your-request-library'; | |
import React from 'react'; | |
import {shallow} from 'enzyme'; | |
import Chance from 'chance'; | |
import chai, {expect} from 'chai'; | |
import sinon from 'sinon'; | |
import sinonChai from 'sinon-chai'; |
// https://github.com/alfonsomunozpomer/react-fetch-mock | |
import React from 'react' | |
import fetchMock from 'fetch-mock' | |
import Enzyme from 'enzyme' | |
import {shallow, mount, render} from 'enzyme' | |
import Adapter from 'enzyme-adapter-react-16' | |
Enzyme.configure({ adapter: new Adapter() }) |
import { LANGUAGE, COUNTRY } from './constants'; | |
export const setLanguage = language => ({ | |
type: LANGUAGE, | |
language | |
}); | |
export const setCountry = country => ({ | |
type: COUNTRY, | |
country | |
}); |