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
source "https://rubygems.org" | |
git_source(:github) { |repo| "https://github.com/#{repo}.git" } | |
ruby "3.1.1" | |
gem "rails", "~> 7.0.0" | |
gem "pg", "~> 1.1" | |
gem "puma", "~> 5.0" | |
gem "jsbundling-rails", "~> 0.1.0" | |
gem "turbo-rails", "~> 1.3.0" |
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
export class ElementObserver { | |
constructor(element, selector, delegate) { | |
this.element = element | |
this.selector = selector | |
this.mutationObserver = new MutationObserver((mutations) => this.processMutations(mutations)) | |
this.delegate = delegate | |
} | |
start() { | |
this.mutationObserver.observe(this.element, { childList: true, subtree: true }) |
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
class TemplateImageView: UIImageView { | |
@IBInspectable var color: String? | |
override init(frame: CGRect) { | |
super.init(frame: frame) | |
self.setUp() | |
} | |
override init(image: UIImage?) { |
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
@implementation UILabel (AutoShrink) | |
- (void)resizeTextToFit | |
{ | |
int currentFontSize = (int) self.font.pointSize; | |
int minimumFontSize = (int) (self.minimumScaleFactor*currentFontSize); | |
UIFont *font = self.font; | |
for(int i = currentFontSize; i > minimumFontSize; i=i-2) |
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
// Extra declarations for the method | |
#define degreesToRadians(degrees) ((degrees)/180.0*M_PI) | |
typedef NS_ENUM(NSUInteger, Direction) | |
{ | |
Clockwise, | |
Anticlockwise | |
}; | |
////////////////////////////////////////// |