This file contains hidden or 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 bash | |
| # checck if pidof exists | |
| PIDOF="$(which pidof)" | |
| # and if not - install it | |
| (test "${PIDOF}" && test -f "${PIDOF}") || brew install pidof | |
| # find app in default paths | |
| CO_PWD=~/Applications/CrossOver.app/Contents/MacOS | |
| test -d "${CO_PWD}" || CO_PWD=/Applications/CrossOver.app/Contents/MacOS |
This file contains hidden or 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
| interface AppLozicStatic { | |
| initPlugin(): any; | |
| } | |
| declare var AppLozic : AppLozicStatic; | |
| export = AppLozic; |
This file contains hidden or 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.sample.medicalconferenceapp.login; | |
| import android.text.TextUtils; | |
| import com.sample.medicalconferenceapp.R; | |
| import com.sample.medicalconferenceapp.login.LoginContract.Presenter; | |
| import com.sample.medicalconferenceapp.model.UserRepo; | |
| import com.sample.medicalconferenceapp.model.pojo.UserPojo; | |
| /** |
This file contains hidden or 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 RealmHelper { | |
| private static RealmConfiguration config; | |
| private static Realm realmInstance; | |
| public static Realm getWriteInstance(Context context) { | |
| if (realmInstance == null || realmInstance.isClosed()) { | |
| // TODO: 15/10/15 Update the code to use Realm.isClosed() | |
| realmInstance = getInstance(context); |
This file contains hidden or 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 android.accounts.Account; | |
| import android.accounts.AccountManager; | |
| import android.content.Intent; | |
| import android.os.Bundle; | |
| import android.util.Log; | |
| import android.widget.TextView; | |
| import com.facebook.AppEventsLogger; | |
| import com.facebook.Session; | |
| import com.facebook.SessionState; |
This file contains hidden or 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
| DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss"); | |
| //get current date time with Calendar() | |
| Calendar cal = Calendar.getInstance(); | |
| System.out.println(dateFormat.format(cal.getTime())); | |
This file contains hidden or 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
| BufferedReader br = new BufferedReader(new FileReader("file.txt")); | |
| try { | |
| StringBuilder sb = new StringBuilder(); | |
| String line = br.readLine(); | |
| while (line != null) { | |
| sb.append(line); | |
| sb.append('\n'); | |
| line = br.readLine(); | |
| } |
This file contains hidden or 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
| Calendar cal = Calendar.getInstance(); | |
| Intent intent = new Intent(this, MyService.class); | |
| PendingIntent pintent = PendingIntent.getService(this, 0, intent, 0); | |
| AlarmManager alarm = (AlarmManager)getSystemService(Context.ALARM_SERVICE); | |
| // Start every 30 seconds | |
| alarm.setRepeating(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis(), 30*1000, pintent); |