Skip to content

Instantly share code, notes, and snippets.

View angeliski's full-sized avatar

Rogerio Angeliski angeliski

View GitHub Profile
@angeliski
angeliski / hash_array_to_csv.rb
Created February 4, 2020 17:38 — forked from christiangenco/hash_array_to_csv.rb
Ruby hash array to CSV
class Array
def to_csv(csv_filename="hash.csv")
require 'csv'
CSV.open(csv_filename, "wb") do |csv|
csv << first.keys # adds the attributes name on the first line
self.each do |hash|
csv << hash.values
end
end
end
@angeliski
angeliski / export.rb
Created August 5, 2020 12:09
export code to gist
require 'net/http'
require 'json'
uri = URI("https://api.github.com/gists")
payload = {
'description' => "export code to gist",
'public' => false,
'files' => {
@angeliski
angeliski / auth.ts
Created October 19, 2023 13:13
Backstage auth0 example
import {
createRouter,
providers,
defaultAuthProviderFactories,
} from '@backstage/plugin-auth-backend';
import {Router} from 'express';
import {PluginEnvironment} from '../types';
export default async function createPlugin(
env: PluginEnvironment,