Skip to content

Instantly share code, notes, and snippets.

View poemsk's full-sized avatar

Poe poemsk

View GitHub Profile
@poemsk
poemsk / mmaug_RxSunshine_build.gradle
Last active August 29, 2015 14:25
mmaug_RxSunshine_build.gradle
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.0'
compile 'com.android.support:support-v4:22.2.0'
compile 'com.squareup.retrofit:retrofit:1.9.0'
compile 'io.reactivex:rxandroid:0.24.0'
compile 'com.android.support:recyclerview-v7:22.2.0'
compile 'com.squareup.picasso:picasso:2.5.2'
}
@poemsk
poemsk / mmaug_WeatherApi.java
Last active August 29, 2015 14:25
mmaug_weather_api
package org.mmaug.rxsunshine;
import com.google.gson.JsonObject;
import retrofit.RestAdapter;
import retrofit.http.GET;
import retrofit.http.Query;
import rx.Observable;
import static org.mmaug.rxsunshine.Config.BASE_URL;
import static org.mmaug.rxsunshine.Config.JSON;
@poemsk
poemsk / mmaug_RxSunshine_Config.java
Last active August 29, 2015 14:25
mmaug_RxSunshine_Config.class
package org.mmaug.rxsunshine;
/**
* Created by poepoe on 16/7/15.
* This is the class that store static values which we will use across the projects
*/
public class Config {
//Base Url
public static final String BASE_URL = "http://api.openweathermap.org/data/2.5/forecast/daily";
@poemsk
poemsk / mmaug_RxSunshine_retrofit.java
Last active August 29, 2015 14:25
mmaug_RxSunshine_retrofit
@GET("/?" + PARAM_MODE + "=" + JSON + "&" + PARAM_UNITS + "=" + METRIC)
void getWeather(@Query(PARAM_QUERY) String cityName,
@Query(PARAM_DAYS) int numOfDays, Callback<JsonObject> callback);
@poemsk
poemsk / mmaug_RxSunshine_row_weather.xml
Last active August 29, 2015 14:25
mmaug_RxSunshine_row_weather.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="8dp"
@poemsk
poemsk / mmaug_RxSunshine_fragment_main.xml
Last active August 29, 2015 14:25
mmaug_RxSunshine_fragment_main.xml
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivityFragment">
<android.support.v7.widget.RecyclerView
android:id="@+id/rv_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
@poemsk
poemsk / mmaug_RxSunshine_WeatherItem.java
Last active August 29, 2015 14:25
mmaug_RxSunshine_WeatherItem
package org.mmaug.rxsunshine;
/**
* Created by poepoe on 17/7/15.
*/
public class WeatherItem {
public String imageUrl;
public String text;
}
@poemsk
poemsk / mmaug_RxSunshine_WeatherAdapter.java
Last active August 29, 2015 14:25
mmaug_RxSunshine_WeatherAdapter
package org.mmaug.rxsunshine;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import com.squareup.picasso.Picasso;
import java.util.ArrayList;
@poemsk
poemsk / mmaug_RxSunshine_MainFragment.java
Last active August 29, 2015 14:25
mmaug_RxSunshine_MainFragment.java
package org.mmaug.rxsunshine;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@poemsk
poemsk / bash-cheatsheet.sh
Created March 9, 2016 05:42 — forked from LeCoupa/bash-cheatsheet.sh
Bash CheatSheet for UNIX Systems
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04