Skip to content

Instantly share code, notes, and snippets.

View Arjun-sna's full-sized avatar
🚧
!

Arjun Arjun-sna

🚧
!
View GitHub Profile
{
"scripts": {
// ... other scripts
"dev-build-android-staging": "ENVFILE=.env.staging react-native run-android",
"dev-build-android-prod": "ENVFILE=.env.prod react-native run-android",
"release-build-android-prod": "export ENVFILE=.env.prod && cd android && ./gradlew assembleRelease && cd ..",
"release-build-android-staging": "export ENVFILE=.env.staging && cd android && ./gradlew assembleRelease && cd ..",
"start-staging-server": "ENVFILE=.env.staging react-native start",
"start-prod-server": "ENVFILE=.env.prod react-native start",
}

Redux WebSocket Middleware: Example

This Gist provides some code examples of how to implement WebSocket stream handling using a Redux middleware. Please be aware that this is only provided as an example and that critical things like exception handling have not been implemented.

A more complete version has been packaged, tested, and is available on GitHub as redux-websocket. This library has also been published to npm at @giantmachines/redux-websocket.

Middleware

This module represents the foundation of the middleware and implements the ideas presented above. The exported function is used during the creation of the Redux store (see the following snippet).

@jasonrudolph
jasonrudolph / 00-about-search-api-examples.md
Last active April 23, 2024 12:01
5 entertaining things you can find with the GitHub Search API
@jboner
jboner / latency.txt
Last active April 25, 2024 01:18
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@he9lin
he9lin / AsyncTaskTests.java
Created March 25, 2012 14:29
How to test AsyncTask in Android
package jieqoo.android.KASS.test.tasks;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import jieqoo.android.models.RESTListener;
import jieqoo.android.models.RESTResponse;
import jieqoo.android.tasks.FetchRESTResponseTask;
import jieqoo.android.util.Configuration;
import android.test.InstrumentationTestCase;
@outbounder
outbounder / ClientHelper.java
Created July 7, 2011 13:08
jersey client helper for trusting all certificates in SSL/TLS
import java.security.SecureRandom;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSession;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;