time.google.com
time1.google.com
time2.google.com
time3.google.com
#!/usr/bin/env ruby | |
require 'pony' | |
def send_mail(to, from, message) | |
Pony.mail({ | |
:to => to, | |
:via => :smtp, | |
:from => from, | |
:subject => 'new migrations detected for master branch', | |
:body => message, |
#!/usr/bin/env ruby | |
require 'pony' | |
def send_mail(to, from, message) | |
Pony.mail({ | |
:to => to, | |
:via => :smtp, | |
:from => from, | |
:subject => 'new migrations detected for master branch', | |
:body => message, |
This PR has many changes so I'd like to break it down, especially since I've bundled multiple tickets (bad practice, just this once I promise! huhu)
DTOs are currently used as a contracts for views as well as a bundling object when methods need to return multiple objects of different types (java doesn’t support returning of tuples)
syncData() now returns a Data Transfer Object that bundles {orderItem, suggestionMap, and replacementMap} so that inheriting classes can just override, call super method and retrieve the updated data
/** | |
* Check device's network connectivity and speed | |
* taken from https://gist.github.com/emil2k/5130324 | |
* @author emil http://stackoverflow.com/users/220710/emil | |
* | |
*/ | |
public class Connectivity { | |
/** | |
* Get the network info |
// Not sure about this but uses a combination of the two: | |
// https://github.com/square/okhttp/issues/350 | |
// https://android.googlesource.com/platform/external/okhttp/+/e78f117bcbd6b57d783737107f445ef75ecb474a/samples/guide/src/main/java/com/squareup/okhttp/recipes/RequestBodyCompression.java | |
public Response proceedGzip(Interceptor.Chain chain) throws IOException { | |
Request originalRequest = chain.request(); | |
Request compressedRequest = originalRequest.newBuilder() | |
.header("Content-Encoding", "gzip") | |
.method(originalRequest.method(), requestBodyWithContentLength(gzip(originalRequest.body()))) | |
.build(); | |
return chain.proceed(compressedRequest); |
//http://siphon9.net/loune/2015/04/dagger-2-0-android-migration-tips/ | |
//http://stackoverflow.com/questions/29703480/dagger-2-and-android-studio-working-but-cant-see-generated-classes | |
apply plugin: 'com.android.application' | |
apply plugin: 'com.neenbedankt.android-apt' | |
buildscript { | |
repositories { | |
mavenCentral() | |
} |
import java.io.UnsupportedEncodingException; | |
import java.util.Map; | |
import java.util.Set; | |
import javax.crypto.Cipher; | |
import javax.crypto.SecretKey; | |
import javax.crypto.SecretKeyFactory; | |
import javax.crypto.spec.PBEKeySpec; | |
import javax.crypto.spec.PBEParameterSpec; |
from: http://stackoverflow.com/questions/1555109/stop-edittext-from-gaining-focus-at-activity-startup/1612017#1612017 | |
Add these properties to any ViewGroup in your layout | |
android:focusable="true" | |
android:focusableInTouchMode="true" |
// orig: http://stackoverflow.com/questions/6465680/how-to-determine-the-screen-width-in-terms-of-dp-or-dip-at-runtime-in-android | |
DisplayMetrics displayMetrics = getResources().getDisplayMetrics(); | |
float dpHeight = displayMetrics.heightPixels / displayMetrics.density; | |
float dpWidth = displayMetrics.widthPixels / displayMetrics.density; |