curl -XDELETE localhost:9200/*
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
-module(rest). | |
-include("/opt/local/lib/erlang/lib/stdlib-1.18.2/include/qlc.hrl"). | |
-include("/opt/local/lib/yaws/include/yaws_api.hrl"). | |
-export([out/1, addAirport/4, handle/2 ]). | |
-define(RECORD_TYPE, airport). | |
-define(RECORD_KEY_FIELD, code). |
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
# | |
# Acts as a nginx HTTPS proxy server | |
# enabling CORS only to domains matched by regex | |
# /https?://.*\.mckinsey\.com(:[0-9]+)?)/ | |
# | |
# Based on: | |
# * http://blog.themillhousegroup.com/2013/05/nginx-as-cors-enabled-https-proxy.html | |
# * http://enable-cors.org/server_nginx.html | |
# | |
server { |
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
# delete local tag '12345' | |
git tag -d 12345 | |
# delete remote tag '12345' (eg, GitHub version too) | |
git push origin :refs/tags/12345 | |
# alternative approach | |
git push --delete origin tagName | |
git tag -d tagName |
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
package main | |
import ( | |
"net/http" | |
"os" | |
"bytes" | |
"path" | |
"path/filepath" | |
"mime/multipart" | |
"io" |
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 compose(...fnArgs) { | |
const [first, ...funcs] = fnArgs.reverse(); | |
return function(...args) { | |
return funcs.reduce((res, fn) => fn(res), first(...args)); | |
}; | |
} |
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
from __future__ import print_function | |
''' | |
Basic Multi GPU computation example using TensorFlow library. | |
Author: Aymeric Damien | |
Project: https://github.com/aymericdamien/TensorFlow-Examples/ | |
''' | |
''' | |
This tutorial requires your machine to have 2 GPUs | |
"/cpu:0": The CPU of your machine. |
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 url from 'url' | |
import qs from 'qs' | |
export default function (ctx) { | |
fixRedirect(ctx) | |
const { route, redirect } = ctx | |
const { path, query } = route | |
// Redirect trailing slashes, preserving query string: /foo/ -> /foo | |
if (path.length > 1 && path.slice(-1) === '/') { |
Create a new Automater flow
Add 'Service'. Service receives 'no input' in 'iTerm'. Add 'Run AppleScript'.
OlderNewer