Skip to content

Instantly share code, notes, and snippets.

View msuzoagu's full-sized avatar

MUA msuzoagu

  • Space
View GitHub Profile
@msuzoagu
msuzoagu / GNU-Make.md
Created August 7, 2023 16:57 — forked from rueycheng/GNU-Make.md
GNU Make cheatsheet

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]}
@msuzoagu
msuzoagu / ruby-versions-chruby.md
Created July 14, 2023 18:44 — forked from ritaly/ruby-versions-chruby.md
Dealing with Ruby versions - chruby

Dealing with Ruby versions - chruby

Every time I sit down to code, it seems like a new Ruby version is available.

When I first learned ruby I used rvm on my Mac. In production on linux, I use rbenv, likely due to its Capistrano integration.

When I set up my current machine, I found rvm had fallen out of fashion in favour of something called chruby.

Install new ruby

@msuzoagu
msuzoagu / timestamp.sh
Created July 10, 2023 01:49 — forked from johnmurch/timestamp.sh
Timestamp output options
#! /bin/bash
# An overly obvious reference for most commonly requested bash timestamps
# Now all you Mac fags can stop pestering me.
cat << EOD
Format/result | Command | Output
------------------------------+----------------------------+------------------------------
YY-MM-DD_hh:mm:ss | date +%F_%T | $(date +%F_%T)
YYMMDD_hhmmss | date +%Y%m%d_%H%M%S | $(date +%Y%m%d_%H%M%S)
@msuzoagu
msuzoagu / README.md
Created July 9, 2023 21:40 — forked from reegnz/README.md
The Terraform group_by you've been missing

The Terraform group_by you've been missing

I'm playing around a lot nowadays with Terraform 0.13 and I found a really interesting feature and that's the ... symbol (also called an ellipsis) to be used with for expressions.

The operator can be used for group_by operations.

Example

We have a list of entries. The list contains employee/manager/project triplets.

@msuzoagu
msuzoagu / IAM Permissions List.md
Created July 4, 2023 19:40 — forked from mechcozmo/IAM Permissions List.md
A list of IAM permissions you can use in policy documents. Collected from the myriad of places Amazon hides them. (incomplete)
@msuzoagu
msuzoagu / xcode-vim.markdown
Created May 5, 2023 06:42 — forked from gdavis/xcode-vim.markdown
Notes for working with Xcode VIM mode

Xcode VIM

Learning VIM in Xcode comes with its own set of challenges and limitations, but there is enough there for you to give your mousing hand a break and master the keyboard.

A limited set of commands are available in Xcode, and this document attempts help ease the learning curve of using VIM in Xcode by providing a handy reference as well as what I find works for me in practice.

NOTE: Commands are case-sensitive. A command of N means pressing shift + n on the keyboard.

This document is a work in progress! Leave a comment if you would like to see a change.

Brew Bundle Brewfile Tips

Copyright & License

Unless otherwise noted (either in this file or in a file's copyright section) the contents of this gist are Copyright ©️2020 by Christopher Allen, and are shared under spdx:Creative Commons Attribution Share Alike 4.0 International (CC-BY-SA-4.) open-source license.

Sponsor

If you more tips and advice like these, you can become a monthly patron on my GitHub Sponsor Page for as little as $5 a month; and your contributions will be multipled, as GitHub is matching the first $5,000! This gist is all about Homebrew, so if you like it you can support it by donating to them or becoming one of their Github Sponsors.

@msuzoagu
msuzoagu / fmap.swift
Created March 30, 2023 00:46 — forked from kostiakoval/fmap.swift
Haskel Fmap in Swift. Get optiona value and call function with that values as parameter
infix operator <^> { associativity left }
func <^><A, B>(f: A -> B, a: A?) -> B? {
switch a {
case .Some(let x): return f(x)
case .None: return .None
}
}
@msuzoagu
msuzoagu / swift-ui-protocol-view-models.swift
Created March 20, 2023 14:58 — forked from neilsmithdesign/swift-ui-protocol-view-models.swift
SwiftUI views with protocol interfaces to view models.
import SwiftUI
/// View model protocol
protocol ViewModel: ObservableObject {
var count: Int { get }
func increase()
}
/// Concrete implementation
class MyViewModel: ViewModel {