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
# Javascript Node CircleCI 2.0 configuration file | |
# | |
# Check https://circleci.com/docs/2.0/language-javascript/ for more details | |
# | |
version: 2 | |
jobs: | |
build: | |
docker: | |
# specify the version you desire here | |
- image: markhobson/node-chrome |
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
private ViewModelProvider.Factory fuelLogViewModelFactory; | |
private FuelLogViewModel fuelLogViewModel; | |
@Override | |
public void onActivityCreated(@Nullable Bundle savedInstanceState) { | |
super.onActivityCreated(savedInstanceState); | |
fuelLogViewModel = ViewModelProviders.of(getActivity(),fuelLogViewModelFactory) | |
.get(FuelLogViewModel.class); | |
observeForAverageConsumption(); |
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
private MutableLiveData<FuelStat> averageFuelConsumption = new MutableLiveData<>(); | |
.... | |
.... | |
public void calculateFuelStat() { | |
averageFuelConsumption.postValue(fuelLogs.calculateFuelStat()); | |
} |
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.mani.fuellog; | |
@RunWith(AndroidJUnit4.class) | |
public class HomeFragmentTest { | |
@Mock | |
private FuelLogViewModel fuelLogViewModel; | |
private MutableLiveData<FuelStat> doubleMutableLiveData = new MutableLiveData<>(); |
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
FragmentScenario.launchInContainer(HomeFragment.class,null,new FragmentFactory(){ | |
@NonNull | |
@Override | |
public Fragment instantiate(@NonNull ClassLoader classLoader, @NonNull String className) { | |
return YourFragment.newInstance(mockedClass); | |
} | |
}); |
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
apply plugin: 'com.android.application' | |
apply plugin: 'jacoco' | |
android { | |
compileSdkVersion 28 | |
defaultConfig { | |
applicationId "com.mani.fuellog" | |
minSdkVersion 15 | |
targetSdkVersion 28 | |
versionCode 1 |
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 Board { | |
private final int BOUNDARY; | |
private final Square boardLayout[][]; | |
public Board(int boundary) { | |
this.BOUNDARY = boundary; | |
boardLayout = new Square[BOUNDARY][BOUNDARY]; | |
} |
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
def min_gt(seq, val): | |
return min([v for v in seq if v > val]) | |
def min_ge(seq, val): | |
return min([v for v in seq if v >= val]) | |
def max_lt(seq, val): | |
return max([v for v in seq if v < val]) | |
def max_le(seq, val): |
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
curl https://slack.com/api/files.upload -F token="${SLACK_TOKEN}" -F channels="${SLACK_CHANNEL}" -F title="${message_title}" -F filename="${filename}" -F file=@"${path_to_file}" |
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
{ | |
if(timer != null) { | |
timer.cancel(); | |
} | |
timer = new Timer(); | |
MyTimerTask myTimerTask = new MyTimerTask(); | |
timer.schedule(myTimerTask, 1000, 5000); | |
} |