Skip to content

Instantly share code, notes, and snippets.

View Macrow's full-sized avatar
🎯
Focusing

Macrow Macrow

🎯
Focusing
  • ChongQing, China
View GitHub Profile
@Macrow
Macrow / gist:99e2be7208dd42d76c0be8556dc785b0
Created May 24, 2017 17:00
Android, RxJava and Retrofit: Wait for multiple network calls to finish
[url]https://newfivefour.com/android-rxjava-wait-for-network-calls-finish.html[/url]
Android, RxJava and Retrofit: Wait for multiple network calls to finish
Say you have multiple network calls you need to make–cals to get Github user information and Github user events for example.
And you want to wait for each to return before updating the UI. RxJava can help you here.
Let’s first define our Retrofit object to access Github’s API, then setup two observables for the two network requests above:
@Macrow
Macrow / java
Last active October 31, 2022 09:47
Android studio 统一替换JCenter为国内阿里云maven
摘要: jcenter替换为国内阿里云maven地址
在你的USER_HOME/.gradle/目录下,新建一个文件init.gradle
把这一段内容拷贝进去
@Macrow
Macrow / readme.md
Last active December 20, 2015 18:19
Configure your JavaScript tests to use truncation instead of transactions

##Configure your JavaScript tests to use truncation instead of transactions:

DatabaseCleaner.strategy = :truncation

###Longer explanation:

The transaction strategy doesn't work well with JavaScript tests, because most JavaScript-capable capybara drivers run the tests in a different thread than the application code.

@Macrow
Macrow / gist:5495645
Created May 1, 2013 14:40
Generate SSDT
https://github.com/Piker-Alpha/RevoBoot/blob/clang/i386/libsaio/acpi/Tools/ssdtPRGen.sh
#! /bin/sh
#
# OS X shell script to fix RMagick compilation issues when using Homebrew's
# ImageMagick installation. This script will create the symlinks needed for
# RMagick to compile. Quantum depths of 8 and 16-bits supported.
#
# You can run this script with "sh whatever_script_name.sh" in your terminal
# or with a click if you change the file extension to "command".
#
# You can manually make the modifications by visiting the ImagicMagick library