Skip to content

Instantly share code, notes, and snippets.

David Francoeur daddykotex

Block or report user

Report or block daddykotex

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
daddykotex / DoobieComposite.scala
Created Nov 20, 2017
If you have a SQL column that allows NULL but you want to fallback to a default rather than using an `Option[T]`, you can define your own composite like that. This is probably nota good way to do it but it works and avoid the throwing of `NonNullableColumnRead`
View DoobieComposite.scala
import java.sql.{ResultSet, PreparedStatement}
import doobie.enum.nullability.Nullable
import doobie.imports._
import doobie.util.meta
import doobie.util.meta.Meta
import doobie.util.kernel.Kernel
sealed trait LoginWay {
import LoginWay._
daddykotex /
Last active Jul 18, 2017
Use an existing python decorator with variable parameters
# pip install tenacity
# Usage:
# → py 4
# The given maximum attempt number is 4
# We want this function to be retried 5 times
# We want this function to be retried 5 times
# We want this function to be retried 5 times
# We want this function to be retried 5 times
# We want this function to be retried 5 times
daddykotex /
Created Oct 17, 2016
Update wordpress via shell access (3.1+)
set -ex
# Update wordpress to a specific version. This script should work with versions above 3.1
# If you provide a LANG_CODE. It will be used to the appropriate Wordpress package.
# LANG_CODE examples: fr_CA, pt_BR, es_ES
# See WP supported languages here:
# See extended WP procedures here:

Keybase proof

I hereby claim:

  • I am daddykotex on github.
  • I am daddykotex ( on keybase.
  • I have a public key ASDZYqHaKPAmTw84LVasQbF3XFK3QMaNH9NLJxTBstuRpAo

To claim this, I am signing this object:

daddykotex /
Created Mar 17, 2015
Test your Spring Rest Template APIs with the new Android Unit testing that requires mocking
import android.util.Log;
import org.apache.http.conn.params.ConnManagerParams;
import org.apache.http.conn.scheme.PlainSocketFactory;
import org.apache.http.conn.scheme.SchemeRegistry;
import org.apache.http.conn.ssl.SSLSocketFactory;
import org.apache.http.impl.client.AbstractHttpClient;
import org.apache.http.impl.client.DefaultHttpClient;
daddykotex /
Last active Apr 20, 2017
Mock Android TextUtils static method
import android.text.TextUtils;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
You can’t perform that action at this time.