This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# rails console | |
ActiveRecord::Base.connection.tables.each do |table| | |
indexes = ActiveRecord::Base.connection.indexes(table) | |
if indexes.length > 0 | |
puts "====> #{table} <====" | |
indexes.each do |index| | |
puts "----> #{index.name}" | |
end | |
puts "====> #{table} <====" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import traceback | |
from typing import Dict, Union, List | |
def traceback_exc(exc: Exception) -> Dict[str, Union[str, List[str]]]: | |
tb = traceback.TracebackException.from_exception( | |
exc, capture_locals=True | |
) | |
return { | |
"title": type(exc).__name__, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# These are here to help the IDE recognise AWS types. | |
# | |
# Place this file outside the 'schema' directory so are not pushed to AWS, | |
# but are still picked up by PhpStorm's GraphQL plugin to help | |
# validate schemas. | |
# | |
# https://docs.aws.amazon.com/appsync/latest/devguide/scalars.html | |
# | |
scalar AWSDateTime | |
scalar AWSDate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |