git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
| # Need to do the following steps: | |
| # 1. create /var/prometheus first. | |
| # 2. run: docker-compose run promdash ./bin/rake db:migrate | |
| nodeexporter: | |
| image: prom/node-exporter | |
| ports: | |
| - "9100:9100" | |
| prometheus: | |
| image: prom/prometheus |
| var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g; | |
| var deburredLetters = { | |
| // Latin-1 Supplement block. | |
| '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A', | |
| '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a', | |
| '\xc7': 'C', '\xe7': 'c', | |
| '\xd0': 'D', '\xf0': 'd', | |
| '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E', | |
| '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e', | |
| '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I', |
| import UIKit | |
| import MessageUI // Import MessageUI | |
| // Add the delegate protocol | |
| class ViewController: UIViewController, MFMessageComposeViewControllerDelegate { | |
| // Send a message | |
| func sendMessage() { | |
| let messageVC = MFMessageComposeViewController() | |
| messageVC.body = "Message String" |
git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
| 1. Using realm.executeTransaction instead realm.beginTransaction and realm.commitTransaction because executeTransaction() automatically handles calling realm.cancelTransaction() in case an exception is thrown. | |
| //Using retrolambda | |
| try(Realm realmInstance = Realm.getDefaultInstance()) { | |
| realmInstance.executeTransaction((realm) -> realm.insertOrUpdate(dog)); | |
| } | |
| 2. Close Realm after opening Realm instances | |
| 3. A tip: you should open your first Realm instance on the UI thread only after the first Activity has been created, just to be safe from context.getFilesDir() == null | |
| 4. using realmREsults.asObservable() or Observable.just(realm.where(...)).find*() | |
| 5. Using findAllSorted() instead of findAll.sort() | |
| 6. Using @Index to speed up |
| https://gist.github.com/evandrix/7058235 |
| [user] | |
| name = Nguyen Trung Cong | |
| email = [email protected] | |
| [color] | |
| ui = true | |
| [merge] | |
| tool = meld | |
| conflictstyle = diff3 | |
| [mergetool "mymeld"] | |
| cmd = meld --diff $BASE $LOCAL --diff $BASE $REMOTE --diff $LOCAL $MERGED $REMOTE |
| using UnityEngine; | |
| using System.Collections; | |
| using UnityEngine.UI; | |
| using Facebook.Unity; | |
| using System.Collections.Generic; | |
| using Facebook.MiniJSON; | |
| public class FBController : MonoBehaviour { | |
| Button[] btn = new Button[4]; |