Skip to content

Instantly share code, notes, and snippets.

View charlesponti's full-sized avatar

Charles Ponti charlesponti

View GitHub Profile
# load libraries
require 'rubygems' rescue nil
require 'wirble'
#require 'json'
alias q exit
class Object
def local_methods
(methods - Object.instance_methods).sort
function Json2CSV(objArray)
{
var
getKeys = function(obj){
var keys = [];
for(var key in obj){
keys.push(key);
}
return keys.join();
}, objArray = format_json(objArray)
@charlesponti
charlesponti / elasticsearch.md
Created November 17, 2015 11:12 — forked from nicolashery/elasticsearch.md
Elasticsearch: updating the mappings and settings of an existing index

Elasticsearch: updating the mappings and settings of an existing index

Note: This was written using elasticsearch 0.9.

Elasticsearch will automatically create an index (with basic settings and mappings) for you if you post a first document:

$ curl -X POST 'http://localhost:9200/thegame/weapons/1' -d \
'{
  "_id": 1,
@charlesponti
charlesponti / python-cli.sh
Created April 26, 2016 09:13 — forked from nepsilon/3-python-module-you-can-use-on-cli.md
3 Python modules you can use directly on the CLI
# Start a local webserver to serve the file of your current directory on the LAN:
# Python version 2.x:
python -m SimpleHTTPServer
# Python version 3.x:
python3 -m http.server
#Start a local SMTP server to debug your app emails. Emails will be printed on stdout:
python -m smtpd -c DebuggingServer -n
#Parse and prettify a JSON string with:
(function($){
var map = {
pickup: 1,
driver: 2,
fare: 3,
car: 4,
city: 5,
payment_method: 6
};