Skip to content

Instantly share code, notes, and snippets.

View frankyston's full-sized avatar
🎯
Ruby on Rails is Fun

Frankyston Lins frankyston

🎯
Ruby on Rails is Fun
View GitHub Profile
You could just make your own pg_dump directly from your Heroku database.
First, get your postgres string using `heroku config:get DATABASE_URL`.
Look for the Heroku Postgres url (example: `HEROKU_POSTGRESQL_RED_URL: postgres://user3123:[email protected]:6212/db982398`), which format is `postgres://<username>:<password>@<host_name>:<port>/<dbname>`.
Next, run this on your command line:
pg_dump --host=<host_name> --port=<port> --username=<username> --password --dbname=<dbname> > output.sql
@frankyston
frankyston / main.dart
Created February 27, 2023 20:13 — forked from leonino/main.dart
Draw Menu
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@frankyston
frankyston / stored_procedure_service.rb
Created February 27, 2023 11:59 — forked from ys/stored_procedure_service.rb
Execute stored procedure
class StoredProcedureService
def self.instance
@instance ||= StoredProcedureService.new
end
def execute(name, *args)
results = []
begin
connection.execute("CALL #{name}(#{args.join(',')})").each(as: :hash, symbolize_keys: true) do |row|
@frankyston
frankyston / docker-pry-rails.md
Created December 21, 2022 17:30 — forked from briankung/docker-pry-rails.md
Using pry-rails with Docker
@frankyston
frankyston / 01_metodos_de_instancia.rb
Created October 8, 2022 12:11 — forked from serradura/01_metodos_de_instancia.rb
Ruby - Métodos de instância VS de classe VS lambda
class Calc
def sum(a, b)
a + b
end
def multiply(a, b)
a * b
end
end
begin
require "bundler/inline"
rescue LoadError => e
$stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler"
raise e
end
gemfile(true) do
source "https://rubygems.org"
@frankyston
frankyston / README.md
Created May 18, 2022 17:36 — forked from hopsoft/README.md
Smart Heroku Review Apps managed by GitHub Actions

Smart Heroku Review Apps managed by GitHub Actions

This gist aims to provide a simple solution for managing Heroku Review Apps with GitHub Actions due to the security incident that continues to disrupt Heroku's GitHub integration.

.github
├── workflows
│   ├── heroku_review_app_create.yml
│   └── heroku_review_app_destroy.yml
@frankyston
frankyston / sign-pdf.rb
Created March 1, 2022 13:42 — forked from matiaskorhonen/sign-pdf.rb
Quick and dirty PDF signing in Ruby (using Origami)
#!/usr/bin/env ruby
require "openssl"
require "time"
begin
require "origami"
rescue LoadError
abort "origami not installed: gem install origami"
end
@frankyston
frankyston / main.rb
Created December 28, 2021 12:41 — forked from leandronsp/main.rb
How to reduce time complexity of nested loops
require 'faker'
require 'benchmark'
def generate_groups
(1..1_000).map do |id|
{ id: id, name: Faker::Educator.primary_school }
end
end
def generate_users(groups_ids)