Skip to content

Instantly share code, notes, and snippets.

View theFreedomBanana's full-sized avatar

theFreedomBanana theFreedomBanana

View GitHub Profile
// Receiving a message
if (currentCall) {
// Define the person sending the message
var callerId = currentCall.callerID;
var originalMessage = currentCall.initialText;
var messageReceived = currentCall.initialText.toLowerCase();
/*
//partie à envoyer dans Recast
@theFreedomBanana
theFreedomBanana / convert_json_to_csv.rb
Created November 8, 2015 09:57
A ruby script to convert Json file to CSV
#Ruby version 2.1.1
require 'csv'
require 'json'
def json_to_csv(json_file, csv_file)
json_array = JSON.parse(File.open(json_file).read)
headers = collect_keys(json_array.first)
CSV.open(csv_file, "w", :write_headers=> true, :headers => headers) do |csv|
json_array.each { |item| csv << collect_values(item) }