This file contains 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
# Index | |
--------------------------------------------------------------------- | |
curl -XPUT http://localhost:9200/pictures/ -d ' | |
{ | |
"settings": { | |
"analysis": { | |
"analyzer": { | |
"index_analyzer": { | |
"tokenizer": "standard", |
This file contains 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
POST tweets/tweet/_search | |
{ | |
"query": { | |
"match_all": {} | |
}, | |
"sort": { | |
"postDate": { | |
"order": "desc" | |
} |
This file contains 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
/*global require, module*/ | |
const ApiBuilder = require('claudia-api-builder'); | |
const api = new ApiBuilder(); | |
module.exports = api; | |
api.corsHeaders('Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Api-Version'); | |
/* define a global function that returns an allowed cors origin. this will be used for the OPTIONS access-control-allow-origin response header */ | |
api.corsOrigin(function (request) { | |
'use strict'; |
This file contains 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
sudo chkconfig --add jenkins-slave --level 2345 | |
sudo chkconfig jenkins-slav on | |
chkconfig | grep jenkins-slave |
This file contains 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
System.setProperty("hudson.model.DirectoryBrowserSupport.CSP", "default-src 'none'; script-src 'self' 'unsafe-inline'; connect-src 'self'; img-src 'self'; style-src 'self'; font-src 'self';") |
This file contains 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
const cloudformation = new AWS.CloudFormation(); | |
const describeStacks = promisifyAWS(cloudformation, 'describeStacks'); | |
// Issue with AWS Code structure. | |
// Not bening fixed, but this should work for the methods I have seen. | |
// https://github.com/aws/aws-sdk-js/issues/278 | |
function promisifyAWS(service, method) { | |
return function(params) { | |
return new Promise(function (resolve, reject) { |
This file contains 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
#!/usr/bin/env bash | |
SITE=https://www.google.com;curl --insecure -v "$SITE" 2>&1 | awk 'BEGIN { cert=0 } /^\* Server certificate:/ { cert=1 } /^\*/ { if (cert) print }' |
This file contains 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
GraphQL Explorer | |
https://developer.github.com/v4/explorer/ | |
Docs | |
https://developer.github.com/v4/ |
This file contains 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
import hoistNonReactStatic from 'hoist-non-react-statics'; | |
import React from 'react'; | |
function getDisplayName(WrappedComponent) { | |
return WrappedComponent.displayName || WrappedComponent.name || 'Component'; | |
} | |
// See: https://facebook.github.io/react/docs/higher-order-components.html | |
export default function mutatable({ mutationName = 'mutate' } = {}) { | |
return (SourceComponent) => { |
This file contains 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 simulateSubmit (errorMessage) { | |
return new Promise((resolve, reject) => { | |
setTimeout(() => { | |
if (errorMessage) reject(new Error(errorMessage)) | |
else resolve() | |
}, 2000) | |
}) | |
} |
OlderNewer