Skip to content

Instantly share code, notes, and snippets.

View manas-raj-shrestha's full-sized avatar
💻

Manas Shrestha manas-raj-shrestha

💻
View GitHub Profile
@manas-raj-shrestha
manas-raj-shrestha / WeatherInteractorImpl.java
Created May 12, 2017 10:11
Snippet for zipping multiple weather calls
public class WeatherInteractorImpl extends BaseInteractor implements WeatherInteractor {
private final static String API_KEY = "";
private final static String UNIT = "si";
private final static int DAY_INCREMENT = 1;
private final static long UNIX_TIME_CONVERSION_CONSTANT = 1000L;
@Override
public Observable<WeatherModel> getWeatherForecastDaily(LatLng latLng, Action1 onNextAction, Action1 onErrorAction) {
Calendar calendar = Calendar.getInstance();
@manas-raj-shrestha
manas-raj-shrestha / MainActivity
Created May 31, 2017 08:15
Variable declarations
class MainActivity : AppCompatActivity(), View.OnClickListener {
val TAG_NUMBER = "number"
val TAG_OPERATOR = "operator"
val TAG_OPERATION = "operation"
val OPERATION_DEL = "⌫"
val OPERATION_CLEAR = "C"
val OPERATION_EQUALS = "="
val OPERATOR_ADD = "+"
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
window.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN)
setContentView(R.layout.activity_main)
setButtonClicks()
}
private fun setButtonClicks() {
(0..grid_layout.childCount)
.filter { grid_layout.getChildAt(it) != null }
.forEach { grid_layout.getChildAt(it).setOnClickListener(this) }
}
public void setOnClicks(GridLayout grid_layout) {
for (int i = 0; i < grid_layout.getChildCount(); i++) {
if (grid_layout.getChildAt(i) != null)
grid_layout.getChildAt(i).setOnClickListener(this);
}
}
public class CustomerDetail{
private String phone;
private String index;
private String about;
private String id;
class CustomerDetail(phone: String?, index: String?, about: String?, id: String?, guide: String?, isActive: String?, picture: String?, balance: String?, address: String?, eyeColor: String?, email: String?, registered: String?, age: String?, name: String?, company: String?, gender: String?, longitude: String?, latitude: String?)
@manas-raj-shrestha
manas-raj-shrestha / ReactNativeShadow
Created July 26, 2018 06:07
React Native Shadow
import React from 'react';
import {StyleSheet, Text, View, Image } from 'react-native';
import {BoxShadow, BorderShadow} from 'react-native-shadow'
import Svg,{
Circle,
Ellipse,
G,
LinearGradient,
RadialGradient,
Line,
@manas-raj-shrestha
manas-raj-shrestha / CustomForm.json
Created December 5, 2019 10:17
Custom forms JSON
[{
"id": "3d7caa4e-15a1-11ea-8d71-362b9e155667",
"name": "Elevation",
"editted_at": "1575359407010",
"component": [{
"type": "section",
"type_data": {
"section_name": "Depth",
"section_id": "4e7caa4e-15a1-11ea-8d71-362b9e155999",
"fields": [{
{
"name": "John",
"age": "16",
"status": "permanent",
"interests": [
"cycling",
"reading",
"football"
]
}