Author: Michael Zeng
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env kotlin -language-version 1.9 | |
// Make sure you run "brew install kotlin graphviz" first. | |
@file:Repository("https://repo.maven.apache.org/maven2/") | |
@file:Repository("https://dl.google.com/dl/android/maven2/") | |
@file:DependsOn("com.squareup.leakcanary:shark-android:3.0-alpha-8") | |
import java.io.File | |
import shark.ActualMatchingReferenceReaderFactory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.? | |
import android.os.Build | |
import android.util.Log | |
import com.varvet.shipgaz.BuildConfig | |
import java.util.regex.Pattern | |
/** | |
* A logger to avoid logging in production. It will check if [BuildConfig.DEBUG] is true or not. | |
* If true then allow logging, otherwise don't. |
Install iTerm 2
Download, unzip and drag to your Applications directory.
https://www.iterm2.com/downloads.html
Install Fish
I've moved this gist to https://github.com/phynet/iOS-Schemes please check it there ;)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension NSNetService { | |
func resolveWithTimeout(timeout: NSTimeInterval, success: () -> ()) { | |
class NetServiceDelegate: NSObject, NSNetServiceDelegate { | |
let oldDelegate: NSNetServiceDelegate? | |
let netService: NSNetService | |
let success: () -> () | |
var holdSelf: NetServiceDelegate? | |
init(netService: NSNetService, success: () -> ()) { | |
self.oldDelegate = netService.delegate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright 2014 Chris Banes | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
You can use this class to realize a simple sectioned RecyclerView.Adapter
without changing your code.
The RecyclerView
should use a LinearLayoutManager
.
You can use this code also with the TwoWayView
with the ListLayoutManager
(https://github.com/lucasr/twoway-view)
This is a porting of the class SimpleSectionedListAdapter
provided by Google
Example:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright (C) 2014 The Android Open Source Project | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
NewerOlder