Skip to content

Instantly share code, notes, and snippets.

View kashifo's full-sized avatar
💻
coding

Kashif Anwaar kashifo

💻
coding
View GitHub Profile
@kashifo
kashifo / ApiInterface
Last active December 12, 2023 08:11
Dish Like Base Reference
@GET("/volumes")
fun searchBooks(@Query("userId") userId: String): Call<List<GBook>>
@Headers("api-key: " + Constants.API_KEY)
@GET("/zelish/user/getuser/{userId}/v1")
Observable<UserData> getUser(@Path("userId") String userId);
@GET("/zelish/v1/section/home/")
Observable<SectionResponse> getSections(@Query("userId") String userId, @Query("pageNo") int pageNo, @Query("size") int size, @Query("country") String country);
@kashifo
kashifo / flutter windows
Last active October 27, 2023 20:18
flutter windows
//old methods
flutter config --enable-windows-desktop
flutter config --enable-macos-desktop
flutter config --enable-linux-desktop
flutter create .
//add windows support to existing project
flutter create --platforms=windows,macos,linux .
firebase login
firebase projects:list
firebase init hosting
firebase use <projectid>
firebase use --add
firebase deploy --only hosting:adcentre
@kashifo
kashifo / CPR with SMA, EMA, VWAP & Super Trend by GuruprasadMeduri by GuruprasadMeduri copy
Created January 11, 2022 04:09
CPR with SMA, EMA, VWAP & Super Trend by GuruprasadMeduri by GuruprasadMeduri
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © GuruprasadMeduri
//@version=4
//***************GUIDE***********************************
//CPR - Applicable only for daily pivots
//CPR - All 3 lines display enabled by default
//CPR - Central Pivot line display cannot changed
//CPR - Central Pivot is a blue line by default and can be changed from settings
//CPR - Top Range & Bottom Ranage display can be changed from settings
val holidayViewModelKotlin = HolidayViewModelKotlin()
holidayViewModelKotlin.getHolidays().observe(this, object: Observer<List<HolidayModelKotlin>> {
override fun onChanged(t: List<HolidayModelKotlin>?) {
holidayAdapterKotlin.addData(t!!)
holidayAdapterKotlin.notifyDataSetChanged()
}
})
class HolidayViewModelKotlin() : ViewModel() {
var holidayRepoKotlin: HolidayRepoKotlin? = null
var mutableLiveData: MutableLiveData<List<HolidayModelKotlin>>? = null
init {
holidayRepoKotlin = HolidayRepoKotlin()
}
fun getHolidays(): LiveData<List<HolidayModelKotlin>> {
class HolidayRepoKotlin {
val TAG = javaClass.simpleName
fun fetchHolidays(): MutableLiveData<List<HolidayModelKotlin>>{
var mutableList: MutableLiveData<List<HolidayModelKotlin>> = MutableLiveData()
val apiInterface = MyApplication.getRetrofitClient().create(ApiInterface::class.java)
apiInterface.getHolidaysKotlin().enqueue(object: Callback<List<HolidayModelKotlin>>{
class HolidayModelKotlin{
var date:String? = null
var name:String? = null
}
public class HolidayViewModel extends ViewModel {
private HolidayRepo holidayRepo;
private MutableLiveData<List<HolidayModel>> mutableLiveData;
public HolidayViewModel(){
holidayRepo = new HolidayRepo();
}
public LiveData<List<HolidayModel>> getHolidays() {
public class HolidayRepo {
private final String TAG = getClass().getSimpleName();
public MutableLiveData<List<HolidayModel>> requestHolidays() {
final MutableLiveData<List<HolidayModel>> mutableLiveData = new MutableLiveData<>();
ApiInterface apiService =
MyApplication.getRetrofitClient().create(ApiInterface.class);