Skip to content

Instantly share code, notes, and snippets.

View wingyplus's full-sized avatar
😶‍🌫️
Burned out

Thanabodee Charoenpiriyakij wingyplus

😶‍🌫️
Burned out
View GitHub Profile
package io.github.wingyplus;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
/**
* Created by wingyplus on 10/6/2016 AD.
*/
@wingyplus
wingyplus / MainActivityTest.java
Created October 1, 2016 15:35
For blog in medium
package io.github.wingyplus.calculator;
import android.support.test.espresso.ViewInteraction;
import android.support.test.rule.ActivityTestRule;
import android.support.test.runner.AndroidJUnit4;
import android.test.suitebuilder.annotation.LargeTest;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewParent;
@Test
public void getSingleUserWithAsynchronousMethod() throws InterruptedException {
User wingyplus = new User();
CountDownLatch signal = new CountDownLatch(1);
userService
.getSingleUser("wingyplus")
.enqueue(new Callback<User>() {
@Override
public void onResponse(Call<User> call, Response<User> response) {
@Test
public void getSingleUserWithSynchronousMethod() throws IOException {
User wingyplus = userService
.getSingleUser("wingyplus")
.execute()
.body();
assertThat(wingyplus.getLogin(), is("wingyplus"));
assertThat(wingyplus.getId(), is(484530));
assertThat(wingyplus.getPublicRepos(), is(197));
package io.github.wingyplus.retrofittut;
import retrofit2.Call;
import retrofit2.http.GET;
import retrofit2.http.Headers;
import retrofit2.http.Path;
public interface UserService {
@Headers({
package io.github.wingyplus.retrofittut;
import org.junit.Before;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;
public class RetrofitTest {
UserService userService;
group 'io.github.wingyplus'
version '1.0-SNAPSHOT'
apply plugin: 'java'
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
mavenCentral()
@wingyplus
wingyplus / init.el
Created August 14, 2016 16:13
Uppercase at any position
(defun upcase-any-pos ()
(interactive)
(backward-word)
(upcase-word 1))
package main
import (
"encoding/json"
"fmt"
"net/http"
"os"
"time"
)
atom-text-editor::shadow {
.cursor {
border-left: 0 none;
background-color: white;
}
}