cd repo
git remote rename origin bitbucket
git remote add origin https://github.com/user/repo.git
git push -u origin master
git remote rm bitbucket
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
import UIKit | |
final class Singleton { | |
static let sharedInstance = Singleton() | |
private init() { } | |
var value = "" | |
} | |
class ViewController: UIViewController { |
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
class AppContext { | |
let device : UIDevice | |
// Delay object creation | |
lazy var dataService: DataService = DataService() | |
// Property is depended on other parts of a class, that aren’t available yet | |
lazy var isTablet: Bool = { [unowned self] in | |
self.device.userInterfaceIdiom == .Pad |
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
public class Activity extends AppCompatActivity { | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
RecyclerView recyclerView = getRecyclerView(); | |
List<Item> items = getItems(); | |
recyclerView.setAdapter(new DataAdapter(items)); | |
} | |
static class Adapter extends DataBoundAdapter<Item, ItemBinding> { |
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
// on a portrait only app, when a video player is launched from a WebView | |
// and the user turn the phone into landscape and then closes the player, | |
// the navigation bar slips under the status bar | |
@property (nonatomic, strong) id observer; | |
- (instancetype)init { | |
@weakify(self); | |
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
__weak __typeof__(self) weakSelf = self; | |
dispatch_group_async(_operationsGroup, _operationsQueue, ^{ | |
__typeof__(self) strongSelf = weakSelf; | |
[strongSelf doSomething]; | |
[strongSelf doSomethingElse]; | |
}); |
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
rm -rf /Applications/Android\ Studio.app | |
rm -rf ~/AndroidStudioProjects | |
rm -rf ~/Library/Preferences/AndroidStudio* | |
rm -rf ~/Library/Application\ Support/AndroidStudio* | |
rm -rf ~/Library/Logs/AndroidStudio* | |
rm -rf ~/Library/Caches/AndroidStudio* | |
rm -rf ~/Library/Android* | |
rm ~/Library/Preferences/com.google.android.studio.plist |
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
git config --global core.editor "'c:/program files/sublime text 3/subl.exe' -w" |
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
# Required files: | |
# domain.crt and godaddy.p7b: provided by Godaddy when exporting | |
# private.key: self-generated file that was needed to create CSR (Certificate signing request) | |
$ openssl pkcs12 -export -in domain.crt -inkey private.key -certfile godaddy.p7b -out domain.pfx | |
# or if you need intermediate .cer instead of .p7b | |
$ openssl pkcs7 -print_certs -in godaddy.p7b -out godaddy.crt | |
$ openssl pkcs12 -export -in domain.crt -inkey private.key -certfile godaddy.cer -out domain.pfx |
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
import Foundation | |
import React | |
@objc(MyModule) | |
class MyModule: RCTEventEmitter { | |
@objc func loadProducts(_ orderId: NSNumber, resolve: RCTPromiseResolveBlock, reject: RCTPromiseRejectBlock) { | |
let products = // load products somehow ... | |
if products { | |
resolve(products); |
OlderNewer