Skip to content

Instantly share code, notes, and snippets.

View shmidt's full-sized avatar

Dima Shmidt shmidt

View GitHub Profile
export DISPLAY=:0
bash -c zsh
case $- in
# Install Ruby Gems to ~/gems
export GEM_HOME=$HOME/gems
export PATH=$HOME/gems/bin:$PATH
# Install Ruby Gems to ~/gems
export GEM_HOME="$HOME/gems"
export PATH="$HOME/gems/bin:$PATH"
@unnamedd
unnamedd / MacEditorTextView.swift
Last active April 14, 2025 11:43
[SwiftUI] MacEditorTextView - A simple and small NSTextView wrapped by SwiftUI.
/**
* MacEditorTextView
* Copyright (c) Thiago Holanda 2020-2021
* https://bsky.app/profile/tholanda.com
*
* (the twitter account is now deleted, please, do not try to reach me there)
* https://twitter.com/tholanda
*
* MIT license
*/
@stinger
stinger / CombineFetcher.swift
Last active January 28, 2023 18:07
Combine - fetching data using URLSession publishers
import Foundation
import Combine
enum APIError: Error, LocalizedError {
case unknown, apiError(reason: String)
var errorDescription: String? {
switch self {
case .unknown:
return "Unknown error"
function fish_prompt
set -l last_status $status
set -l cyan (set_color -o cyan)
set -l yellow (set_color -o yellow)
set -l red (set_color -o AE111D)
set -l blue (set_color -o blue)
set -l green (set_color -o green)
if not set -q __fish_git_prompt_show_informative_status
set -g __fish_git_prompt_show_informative_status 1
@AnnoyingTechnology
AnnoyingTechnology / Apple's SuperDrive tweak for use with Linux.md
Last active February 28, 2025 11:28
Make Apple's USB SuperDrive work on Linux

I was ready to throw it away, I opened it up and didn't find anything wrong with it. After a quick Google Search, turns out Apple fucked up their users (again) and locked this drive to only one laptop : the MacBook Air.

Bellow is the tweak (found online) to make it usable on Linux

# Debian/linux only - Linux SCSI generic driver
sudo apt install sg3-utils -y
@mutsune
mutsune / darkmode.sh
Created January 17, 2019 04:37
enable/disable Dark Mode scripts
function enable_darkmode() {
set_darkmode "$1" "no"
}
function disable_darkmode() {
set_darkmode "$1" "yes"
}
function set_darkmode() {
app="$1"
import Foundation
extension Collection where Element: Comparable {
func sorted(ascending: Bool = true, using comparator: (Element) -> (Element) -> ComparisonResult) -> [Element] {
return self.sorted { lhs, rhs in
comparator(lhs)(rhs) == (ascending ? .orderedAscending : .orderedDescending)
}
}
}
  • List all modified file names

    • git whatchanged --since '12/01/2016' --oneline --name-only --pretty=format: | sort | uniq
    • git log --since="4 day ago" --name-only --pretty=format: | sort -u
    • git whatchanged --since '12/01/2016' --until '12/06/2016' --oneline --name-only --pretty=format: | sort | uniq
  • Stash

    • git stash
    • git stash list (Get all stash(s))
    • git stash pop (Reapply stash and remove)
  • git stash apply (Reapply stash and keep copy)

@tdegrunt
tdegrunt / .gitignore
Created May 22, 2018 07:13
Ruby programming with VS Code
*.gem
*.rbc
/.config
/coverage/
/InstalledFiles
/pkg/
/spec/reports/
/spec/examples.txt
/test/tmp/
/test/version_tmp/
@mecid
mecid / ViewModelComposition.swift
Last active September 12, 2018 19:45
Mastering MVVM
import Bond
import ReactiveKit
class UserProfileViewModel {
let refreshing = Observable<Bool>(false)
let username = Observable<String>("")
let photos = Observable<[Photos]>([])
private let userViewModel: UserViewModel
private let photosViewModel: PhotosViewModel