Skip to content

Instantly share code, notes, and snippets.

View jz709u's full-sized avatar

J jz709u

  • Denver
View GitHub Profile
@jz709u
jz709u / Calendar.swift
Last active March 2, 2023 03:41 — forked from mecid/Calendar.swift
SwiftUI Calendar view using LazyVGrid
import SwiftUI
fileprivate extension DateFormatter {
static var month: DateFormatter {
let formatter = DateFormatter()
formatter.dateFormat = "MMMM"
return formatter
}
static var monthAndYear: DateFormatter {
@jz709u
jz709u / bash profile and bashrc.md
Last active July 23, 2020 17:03
.bash_profile, .bashrc #jz709u #bashrc #bash_profile #bash

When you start bash as an interactive shell (i.e., not to run a script), it reads ~/.bashrc (except when invoked as a login shell, then it only reads ~/.bash_profile or ~/.profile).

  • ~/.profile is the place to put stuff that applies to your whole session, such as programs that you want to start when you log in (but not graphical programs, they go into a different file), and environment variable definitions.

  • ~/.bashrc is the place to put stuff that applies only to bash itself, such as alias and function definitions, shell options, and prompt settings. (You could also put key bindings there, but for bash they normally go into ~/.inputrc.)

  • ~/.bash_profile can be used instead of ~/.profile, but it is read by bash only, not by any other shell. (This is mostly a concern if you want your initialization files to work on multiple machines and your login shell isn't bash on all of them.) This is a logical place to include ~/.bashrc if the shell is interactive. I recommend the following contents in

@jz709u
jz709u / Setup Python 3 on CentOS.md
Last active July 23, 2020 17:03
Setup python on centOS #jz709u #Python #CentOS
@jz709u
jz709u / Setup Amazon Lightsail with ssh.md
Last active July 23, 2020 16:41
Setup Amazon Lightsail with ssh. #jz709u #SSH #Amazon-Lightsail