Skip to content

Instantly share code, notes, and snippets.

View boek's full-sized avatar
🔥
🦊

Jeff Boek boek

🔥
🦊
View GitHub Profile
# Add this to your .oh-my-zsh theme if you're using those, or directly to your zsh theme :)
# Colors vary depending on time lapsed.
ZSH_THEME_GIT_TIME_SINCE_COMMIT_SHORT="%{$fg[green]%}"
ZSH_THEME_GIT_TIME_SHORT_COMMIT_MEDIUM="%{$fg[yellow]%}"
ZSH_THEME_GIT_TIME_SINCE_COMMIT_LONG="%{$fg[red]%}"
ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL="%{$fg[cyan]%}"
#Customized git status, oh-my-zsh currently does not allow render dirty status before branch
git_custom_status() {
protocol HTTPHandlerType {
typealias Data
/// :returns: true if the request was handled; false otherwise
func handle(request: HTTPRequest, data: Data) -> Bool
func foo(request: HTTPRequest, data: Data) -> Bool
}
class MyHandler : HTTPHandlerType {
import Foo
typealias Bar = Foo.Bar
typealias Bars = [Foo.Bar]
func buildView<T: UIView>(closure: ((T) -> ())? = nil) -> T {
let view = T(frame: CGRectZero)
view.setTranslatesAutoresizingMaskIntoConstraints(false)
closure?(view)
return view
}
extension UIView {
static func build<T: UIView>(builder: ((T) -> ())? = nil) -> T {
let view = T(frame: .zero)
view.setTranslatesAutoresizingMaskIntoConstraints(false)
builder?(view)
return view
}
}
@boek
boek / keybase.md
Created April 16, 2017 06:48
Keybase verification

Keybase proof

I hereby claim:

  • I am boek on github.
  • I am boek (https://keybase.io/boek) on keybase.
  • I have a public key ASDdXm8DCOGZyRojl92MyTxniMOIEcmfIiewRs0kzYQO2wo

To claim this, I am signing this object:

@boek
boek / test.swift
Last active October 12, 2017 19:33
func test08PasteAndGo() {
let app = XCUIApplication()
// Inject a string into clipboard
let clipboardString = "Hello world"
UIPasteboard.general.string = clipboardString
// Enter 'mozilla' on the search field
let searchOrEnterAddressTextField = app.textFields["URLBar.urlText"]
searchOrEnterAddressTextField.typeText("mozilla.org\n")

Keybase proof

I hereby claim:

  • I am boek on github.
  • I am boek (https://keybase.io/boek) on keybase.
  • I have a public key ASDJxtcjBSwGaGa9fKKkNZqox5wZQdS5i3RdbYlxerrJGQo

To claim this, I am signing this object:

extension Subreddit {
var data: Data { NSKeyedArchiver.archivedData(withRootObject: self) }
}
let currentSubreddit: Subreddit? = nil
let currentSubredditData = currentSubreddit?.data
--- a/app/src/main/java/org/mozilla/fenix/library/history/viewholders/HistoryListItemViewHolder.kt
+++ b/app/src/main/java/org/mozilla/fenix/library/history/viewholders/HistoryListItemViewHolder.kt
@@ -45,8 +45,6 @@ class HistoryListItemViewHolder(
showDeleteButton: Boolean,
mode: HistoryFragmentState.Mode
) {
- this.item = item
-
itemView.history_layout.titleView.text = item.title
itemView.history_layout.urlView.text = item.url