Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View msuzoagu's full-sized avatar

MUA msuzoagu

  • Space
View GitHub Profile
@hoppsen
hoppsen / UIFont+DynamicTypeSizes.swift
Last active January 27, 2023 18:02
UIFont extension for (the gradual introduction of) Dynamic Type Sizes, but only enabled in DEBUG mode.
//
// UIFont+DynamicTypeSizes.swift
//
// https://gist.github.com/hoppsen/6b752057b98fa7527ee1f4d4ba05fef0
//
// More about Apple's Typography can be found here:
// https://developer.apple.com/design/human-interface-guidelines/ios/visual-design/typography/
import UIKit

ZSH CheatSheet

This is a cheat sheet for how to perform various actions to ZSH, which can be tricky to find on the web as the syntax is not intuitive and it is generally not very well-documented.

Strings

Description Syntax
Get the length of a string ${#VARNAME}
Get a single character ${VARNAME[index]}
@lisawolderiksen
lisawolderiksen / git-commit-template.md
Last active April 22, 2024 13:01
Use a Git commit message template to write better commit messages

Using Git Commit Message Templates to Write Better Commit Messages

The always enthusiastic and knowledgeable mr. @jasaltvik shared with our team an article on writing (good) Git commit messages: How to Write a Git Commit Message. This excellent article explains why good Git commit messages are important, and explains what constitutes a good commit message. I wholeheartedly agree with what @cbeams writes in his article. (Have you read it yet? If not, go read it now. I'll wait.) It's sensible stuff. So I decided to start following the

@mechcozmo
mechcozmo / IAM Permissions List.md
Last active February 15, 2024 20:35
A list of IAM permissions you can use in policy documents. Collected from the myriad of places Amazon hides them. (incomplete)
@gblancogarcia
gblancogarcia / AppDelegate.swift
Last active January 27, 2023 18:00
Core Data: preloading an existing SQLite database
import UIKit
import CoreData
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
return true
@SabretWoW
SabretWoW / rspec_model_testing_template.rb
Last active March 7, 2024 03:56
Rails Rspec model testing skeleton & cheat sheet using rspec-rails, shoulda-matchers, shoulda-callbacks, and factory_girl_rails. Pretty much a brain dump of examples of what you can (should?) test in a model. Pick & choose what you like, and please let me know if there are any errors or new/changed features out there. Reddit comment thread: http…
# This is a skeleton for testing models including examples of validations, callbacks,
# scopes, instance & class methods, associations, and more.
# Pick and choose what you want, as all models don't NEED to be tested at this depth.
#
# I'm always eager to hear new tips & suggestions as I'm still new to testing,
# so if you have any, please share!
#
# @kyletcarlson
#
# This skeleton also assumes you're using the following gems:
@Peeja
Peeja / gist:5831155
Created June 21, 2013 13:33
"The goggles, they do nothing!" `rake db:test:prepare` appears to have become `rake test:prepare` in Rails 4, but the old task still exists and does nothing. http://stackoverflow.com/q/17150529/4937
$ rake --trace db:test:prepare
** Invoke db:test:prepare (first_time)
** Execute db:test:prepare
$ rake --trace test:prepare
** Invoke test:prepare (first_time)
** Invoke db:test:prepare (first_time)
** Execute db:test:prepare
** Invoke db:test:load (first_time)
** Invoke db:test:purge (first_time)