Skip to content

Instantly share code, notes, and snippets.

View JohannMG's full-sized avatar
🐺

Johann Garces JohannMG

🐺
View GitHub Profile
@JohannMG
JohannMG / TrelloAutoCommentBookmarklet.js
Created June 6, 2016 20:11
Trello Auto-Add-Comment Developer Cross-check Bookmarklet
javascript:(function()%7Bdocument.getElementsByClassName(%27js-new-comment-input%27)%5B0%5D.value%2B%3D%27Dev cross-check: ✅%27%3B%24(%27.js-add-comment%27).removeAttr(%27disabled%27)%3B%24(%27.js-add-comment%27).click()%3B%7D)()%3B
@JohannMG
JohannMG / TrelloAutoComment.js
Created June 6, 2016 20:13
Trello Auto Comment JS for Bookmlarket
document.getElementsByClassName('js-new-comment-input')[0].value += 'Developer cross-check: ✅';
$('.js-add-comment').removeAttr('disabled');
$('.js-add-comment').click();
// Use this nifty thing to turn into a bookmark -> http://ted.mielczarek.org/code/mozilla/bookmarklet.html

###Maps Externalization

  • All Maps assets in CCMFramework were moved and consolidated externally in a MapsAndDiscounts folder.
  • It has all the Storyboards, xibs, assets, and code.
  • All views that were in HomeScreen.storyboard were moved to MapsDiscounts.storyboard
  • Assets that MapsAndDiscounts used were moved to their own asset catalog.

They are consolidated in xcode and the filesystem ios_ccm/CCM/MapsAndDiscounts *Please keep them organized in that folder b/c wel need to copy this entire folder and its content to AAAMobile every build. *

@JohannMG
JohannMG / CCMApiCheckBitBar.swift
Last active May 30, 2017 18:29
Quick check off to keep tabs. (Swift 3)
//
// main.swift
// EndpointsCheck
//# <bitbar.title>CCM Status</bitbar.title>
//# <bitbar.version>v1.0</bitbar.version>
//# <bitbar.author>JohannMG</bitbar.author>
//# <bitbar.author.github>JohannMG</bitbar.author.github>
//# <bitbar.desc>Polls cached tests</bitbar.desc>
//# <bitbar.image></bitbar.image>
@JohannMG
JohannMG / heightWithConstrainedWidth.swift
Created December 22, 2016 20:32
Get height for constrained width string.
extension String {
func heightWithConstrainedWidth(_ width: CGFloat, font: UIFont) -> CGFloat {
let constraintRect = CGSize(width: width, height: CGFloat.greatestFiniteMagnitude)
let boundingBox = (self as NSString).boundingRect(with: constraintRect,
options: .usesLineFragmentOrigin,
attributes: [NSFontAttributeName: font],
context: nil)
return boundingBox.height
}
}
@JohannMG
JohannMG / Date.swift
Created December 22, 2016 20:34
Date extension to get pretty Apple-mail like labels.
import Foundation
extension Date {
func formattedMessageDate() -> String {
let startOfToday = Calendar.current.startOfDay(for: Date())
let startOfDate = Calendar.current.startOfDay(for: self)
@JohannMG
JohannMG / AppMission.txt
Last active March 2, 2017 23:55
You track your anxiety daily at the end in self-reflection. Imagine if your Dr could prescribe an app to go along with your therapy or medication or any self-improvement plan.
I'm writing this in an airport half asleep so please forgive all the spelling and grammar mistakes <3
Mini mission statement:
As I was dropping out of college i wrote one last long essay and it was a long take that the most impotant key to happiness is being able to introspect and find what makes you happy and unhappy. Then acting on it.
The App:
You track your anxiety daily at the end in self-reflection. Imagine if your Dr could prescribe an app to go along with your therapy or medication or any self-improvement plan.
-> Anxiety Symptoms vs Behaviors
//: Playground - noun: a place where people can play
import UIKit
import PlaygroundSupport
let mainView = UIView(frame: CGRect(origin: CGPoint.zero, size: CGSize(width: 300, height: 400)))
mainView.backgroundColor = UIColor(hue: 0.3, saturation: 0.10, brightness: 0.9, alpha: 1.0)
PlaygroundPage.current.liveView = mainView
@JohannMG
JohannMG / UIStackView-Inside-UIScrollView.swift
Last active February 8, 2017 02:25
Playground sketch in Swift 3. Not to replace a UITableView but to make a fixed stack to up and down.
//: Playground - noun: a place where people can play
import UIKit
import PlaygroundSupport
func getMeANewView() -> UIView {
let randomHue = (Double( arc4random_uniform(101) ) - 1.0) / 100.0
let newView = UIView(frame: CGRect(x: 0, y: 0, width: 250, height: 50))
newView.backgroundColor = UIColor(hue: CGFloat(randomHue), saturation: 0.5, brightness: 0.5, alpha: 1.0)
// newView.widthAnchor.constraint(equalToConstant: 250).isActive = true
@JohannMG
JohannMG / POIBottomPointingView.swift
Created February 9, 2017 02:43
Playground: Draws a little view with a triangle point at the center bottom pointing down.
//: Playground - noun: a place where people can play
import UIKit
import PlaygroundSupport
class ReminderView : UIView {
let popupColor = UIColor(white: 0.0, alpha: 0.16)
let drawingCornerRadius: CGFloat = 6.0
let bubbleHeightRatio: CGFloat = 0.83
let label = UILabel()