Skip to content

Instantly share code, notes, and snippets.

View daveshah's full-sized avatar
💭
💻

Dave Shah daveshah

💭
💻
View GitHub Profile
@daveshah
daveshah / LinkedText.swift
Created September 8, 2021 17:26 — forked from mjm/LinkedText.swift
Tappable links in SwiftUI Text view
import SwiftUI
private let linkDetector = try! NSDataDetector(types: NSTextCheckingResult.CheckingType.link.rawValue)
struct LinkColoredText: View {
enum Component {
case text(String)
case link(String, URL)
}
@daveshah
daveshah / tmux-cheatsheet.markdown
Created January 31, 2017 15:27 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@daveshah
daveshah / spacemacs_hint.md
Created January 26, 2017 16:52 — forked from ivar/spacemacs global search and replace.md
spacemacs - global search and replace

There's a couple of ways, one way is

  • Get search results
    • Do SPC / and type in your search string
    • or SPC x S and search string - where x is your scope indicator (p for project, d for directory, etc..)
  • Once you have the occurences you want, hit C-c C-e inside the helm buffer to put all your match occurences and puts them into a special buffer called the edit buffer or something like that
  • in that buffer you can use any commands you'd normally use on a buffer
  • the C-c C-c to commit your changes.
@daveshah
daveshah / replace.sh
Created May 27, 2016 09:22 — forked from hlissner/replace.sh
Bulk search & replace with ag (the_silver_searcher)
# ag <https://github.com/ggreer/the_silver_searcher>
# usage: ag-replace.sh [search] [replace]
# caveats: will choke if either arguments contain a forward slash
# notes: will back up changed files to *.bak files
ag -l $1 | xargs perl -pi.bak -e "s/$1/$2/g"
# or if you prefer sed's regex syntax:
ag -l $1 | xargs sed -ri.bak -e "s/$1/$2/g"
/**
* A collection of authentication and account connection utilities. With strong inspiration from the Google IO session
* app.
* @author Dandré Allison
*/
public class AccountUtils {
/**
* Interface for interacting with the result of {@link AccountUtils#getUserProfile}.
*/
*.csproj -text merge=union
*.sln -text merge=union
find . -type f | awk -F'.' '{print $NF}' | sort| uniq -c | sort -g