To convert json to csv with headers using jq
and the @csv
filter.
jq -r '[first|keys_unsorted] + map([.[]]) | .[] | @csv' example.json > converted.csv
This would work on a simple json structured like:
[
desc 'Raise exception if used in production' | |
task protect_prod: [:environment] do | |
raise 'This task cannot be run in production' if Rails.env.production? | |
end | |
['db:drop', 'db:reset', 'db:seed'].each do |t| | |
Rake::Task[t].enhance ['protect_prod'] | |
end |
default 10:29:06.571795-0500 runningboardd Launch request for app<application.com.pradeepb28.Writersbrew-AI.139652389.139652395(501)>[0] is using uid 501 (divined from auid 501 euid 501) | |
default 10:29:06.571890-0500 runningboardd Acquiring assertion targeting app<application.com.pradeepb28.Writersbrew-AI.139652389.139652395(501)> from originator [app<application.com.raycast.macos.139445517.139445575(501)>:71558] with description <RBSAssertionDescriptor| "LS launch com.pradeepb28.Writersbrew-AI" ID:391-71558-60820 target:app<application.com.pradeepb28.Writersbrew-AI.139652389.139652395(501)> attributes:[ | |
<RBSDomainAttribute| domain:"com.apple.launchservicesd" name:"LaunchRoleUserInteractive" sourceEnvironment:"(null)"> | |
]> | |
default 10:29:06.571979-0500 runningboardd Assertion 391-71558-60820 (target:app<application.com.pradeepb28.Writersbrew-AI.139652389.139652395(501)>) will be created as active | |
default 10:29:06.572211-0500 runningboardd Executing launch request for app<application.com.pradeepb28.Writersbrew- |
To convert json to csv with headers using jq
and the @csv
filter.
jq -r '[first|keys_unsorted] + map([.[]]) | .[] | @csv' example.json > converted.csv
This would work on a simple json structured like:
[
function HelloWorld(str) { | |
this.str = str; | |
this.speak = function() { | |
console.log("hello", this.str); | |
} | |
}; | |
var h = new HelloWorld("world"); | |
h.speak(); | |
(new HelloWorld("Jupiter")).speak(); |
# A small script to generate memorable one-time codes. | |
# | |
# OneTimeCode.generate | |
# => "ubahow-idea-easy-aveda" | |
class OneTimeCode | |
def initialize(length = 12) | |
@length = length | |
@mod_result = MOD_RESULT.sample | |
end |
# This example follows a Stripe webhook through the application life cycle. | |
# In this case, a customer has created a Checkout, which is an object in our application that acts like a shopping cart. | |
# It relates to the products that are being purchased and encapsulates the customer's existing record, or the data required to create a new customer. | |
class Checkout < ApplicationRecord | |
include Amountable | |
include BtcpayInvoice | |
include StripePaymentIntent | |
belongs_to :user, optional: true |
{"version":1,"resource":"file:///Users/ryanheneise/Projects/api/src/services/fees/index.js","entries":[{"id":"DXVN.js","timestamp":1667270770299},{"id":"VJk1.js","timestamp":1667270856905},{"id":"pi2q.js","timestamp":1667271038502}]} |
# frozen_string_literal: true | |
module MxIsoagent | |
class Client | |
BOARDING_URL = Rails.configuration.mx_iso_agent['boarding_url'] | |
CHECKOUT_URL = Rails.configuration.mx_iso_agent['checkout_url'] | |
INVITE_CODE = Rails.configuration.mx_iso_agent['invite_code'] | |
BOARDING_KEYS = Rails.configuration.mx_iso_agent['api_key'] | |
BUSINESS_TYPES = [ |
# frozen_string_literal: true | |
module GravatarHelper | |
def gravatar_image_tag(email, attrs = {}) | |
attrs = { | |
class: 'h-10 w-10 rounded-full' | |
}.update(attrs) | |
image_tag gravatar_url(email), attrs | |
end |
We're looking for a talented and competent Ruby on Rails developer to help us re-engineer an existing app that's hard to maintain and expensive. The existing app is built using React on the frontend and Apache Airflow on the backend. We're going to re-engineer the app to make it more maintainable and remove some unneeded complexity that makes it difficult to maintain and expensive to develop.
The purpose of this app is to receive credit card processing reports, apply a markup algorithm, and then generate a report for each store based on the result.
The current process is handled by two separate apps: