Skip to content

Instantly share code, notes, and snippets.

View shmidt's full-sized avatar

Dima Shmidt shmidt

View GitHub Profile
@shmidt
shmidt / DetailViewController.m
Last active August 29, 2015 14:00 — forked from GiK/DetailViewController.m
Dismiss search bar (ARC)
/*
This sample uses your application's keyWindow - the window that all other views hang from. Since UIWindow is simply a subclass of UIView, we can add gesture recognizers to it.
No matter where you tap or scroll - the master view's table view, or a map in the detail view - the keyboard will be dismissed and your pan/tap gesture continues unhindered.
*/
// Adopt UIGestureRecognizerDelegate and UISearchBarDelegate protocols in .h
@shmidt
shmidt / Swift3Base64.swift
Last active September 19, 2022 08:18 — forked from stinger/Swift3Base64.swift
Swift 3: Base64 encoding and decoding strings
//: # Swift 3: Base64 encoding and decoding
import Foundation
extension String {
//: ### Base64 encoding a string
func base64Encoded() -> String? {
if let data = self.data(using: .utf8) {
return data.base64EncodedString()
}
return nil
@shmidt
shmidt / fedora_post_install.md
Last active May 27, 2023 22:15 — forked from zobayer1/fedora_post_install.md
Fedora 34 Post Installation (For Developers). Things you should do after installing your new Fedora workstation.

Fedora 34 Post Installation (For Developers)

Things you should do after installing your new Fedora workstation.

Fix kernel panic when computer turns off

sudo nano -w /etc/default/grub
Append blacklist string GRUB_CMDLINE_LINUX="rhgb quiet initcall_blacklist=dw_i2c_init_driver"
Ctrl + O Save the file.
sudo grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg
@shmidt
shmidt / Observable.swift
Created March 12, 2022 06:47 — forked from kumabook/Observable.swift
Observer pattern with swift protocol extension
import Foundation
public protocol Observer: Equatable {
associatedtype EventType
func listen(_ event: EventType)
}
public protocol Observable {
associatedtype ObserverType: Observer
associatedtype EventType