Skip to content

Instantly share code, notes, and snippets.

View rafaelwkerr's full-sized avatar
😃
Learning Functional Programming

Rafael Kerr rafaelwkerr

😃
Learning Functional Programming
View GitHub Profile
@rafaelwkerr
rafaelwkerr / gist:8dd345bf5fea936421e0733e6a7daccb
Created December 10, 2020 11:14
Docker without sudo Ubuntu
sudo usermod -aG docker ${USER}
su - ${USER}
sudo usermod -aG docker username
@rafaelwkerr
rafaelwkerr / chrome-disable-cors.sh
Created August 26, 2019 14:42
Disable CORS on Chrome boot
google-chrome-stable --disable-web-security --disable-gpu --user-data-dir=~/chromeTemp.
@rafaelwkerr
rafaelwkerr / docker_command.txt
Last active January 3, 2018 21:47
Stop / remove all Docker containers
docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)
@rafaelwkerr
rafaelwkerr / log_error_adp_store_app
Created September 25, 2017 16:17
App Store (ADP) error log when trying to update some application
09-25 11:34:08.208 3629-3629/cielo.apps E/AndroidRuntime: FATAL EXCEPTION: main
Process: cielo.apps, PID: 3629
java.lang.RuntimeException: Unable to start receiver cielo.store.application.receivers.DownloadBroadCastReceiver: java.lang.RuntimeException: Parcelable encountered IOException writing serializable object (name = cielo.store.domain.model.RemoteApp)
at android.app.ActivityThread.handleReceiver(ActivityThread.java:2838)
at android.app.ActivityThread.access$1700(ActivityThread.java:178)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1547)
at android.os.Handler.dispatchMessage(Handler.java:111)
@rafaelwkerr
rafaelwkerr / Event-stream based GraphQL subscriptions.md
Created November 9, 2016 12:40 — forked from OlegIlyenko/Event-stream based GraphQL subscriptions.md
Event-stream based GraphQL subscriptions for real-time updates

In this gist I would like to describe an idea for GraphQL subscriptions. It was inspired by conversations about subscriptions in the GraphQL slack channel and different GH issues, like #89 and #411.

Conceptual Model

At the moment GraphQL allows 2 types of queries:

  • query
  • mutation

Reference implementation also adds the third type: subscription. It does not have any semantics yet, so here I would like to propose one possible semantics interpretation and the reasoning behind it.

@rafaelwkerr
rafaelwkerr / SampleTest.java
Created March 22, 2016 22:48 — forked from rodrigohenriques/SampleTest.java
Testing asyncronous observables to parallelize work
public class SampleTest {
@Test
public void testObservableParallel() {
List<String> terminals = new ArrayList<>();
for (int i = 0; i < 100000; i++) {
terminals.add(i, String.format("Terminal %s", i + 1));
}
PublishSubject<String> publisher = PublishSubject.create();
@rafaelwkerr
rafaelwkerr / SelectNumber.java
Last active March 15, 2016 02:00
A method to extract just numbers from some string
public String selectNumbers(String someString) {
if (someString != null) {
return someString.trim().replaceAll("[^0-9]", "");
} else {
return null;
}
}
@rafaelwkerr
rafaelwkerr / build.gradle
Created March 8, 2016 14:01
Add Espresso Dependencies to your project :)
testCompile 'junit:junit:4.12'
testCompile 'org.hamcrest:hamcrest-all:1.3'
//Provides AndroidJUnitRunner
androidTestCompile ('com.android.support.test:runner:0.4.1') {
exclude group: 'com.android.support', module: 'appcompat'
exclude group: 'com.android.support', module: 'support-v4'
exclude module: 'recyclerview-v7'
exclude module: 'support-annotations'
}
@rafaelwkerr
rafaelwkerr / iterm2-solarized.md
Created March 6, 2016 16:21 — forked from magnocosta/iterm2-solarized.md
iTerm2 + oh my zsh + solarized + Meslo powerline font (OSX)

Solarized

@rafaelwkerr
rafaelwkerr / gist:b44bb62b43ada5953465
Created February 27, 2016 15:28
Remove Android Focus on EditText
<!-- Dummy item to prevent AutoCompleteTextView from receiving focus -->
<LinearLayout
android:focusable="true"
android:focusableInTouchMode="true"
android:layout_width="0px"
android:layout_height="0px"/>
<!-- :nextFocusUp and :nextFocusLeft have been set to the id of this component
to prevent the dummy from receiving focus again -->
<AutoCompleteTextView android:id="@+id/autotext"