Skip to content

Instantly share code, notes, and snippets.

Cristian Duarte Cristo86

Block or report user

Report or block Cristo86

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
@Cristo86
Cristo86 / crashes.log
Last active Sep 28, 2017
HiFi Crashes List
View crashes.log
09-27 18:06:45.669 23857-23857/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
09-27 18:06:45.670 23857-23857/? A/DEBUG: Build fingerprint: 'HUAWEI/LON-L29/HWLON:7.0/HUAWEILON-L29/C900B159SP07:user/release-keys'
09-27 18:06:45.670 23857-23857/? A/DEBUG: Revision: '0'
09-27 18:06:45.670 23857-23857/? A/DEBUG: ABI: 'arm'
09-27 18:06:45.670 23857-23857/? A/DEBUG: pid: 23059, tid: 23120, name: QtThread >>> io.highfidelity.hifiinterface <<<
09-27 18:06:45.670 23857-23857/? A/DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x26
09-27 18:06:45.670 23857-23857/? A/DEBUG: r0 b07b2240 r1 bedff830 r2 917752c0 r3 0000000a
09-27 18:06:45.671 23857-23857/? A/DEBUG: r4 bedff830 r5 e362c400 r6 c52b1be0 r7 00000002
09-27 18:06:45.671 23857-23857/? A/DEBUG: r8 0000000c r9 00000000 sl 00000000 fp c52b1f78
09-27 18:06:45.671 23857-23857/? A/DEBUG: ip c8528ab4 sp c52b1bc0 lr c90e0a21 pc c90e0a3c cpsr 80070030
@Cristo86
Cristo86 / findLinePlaneIntersectionCoords.js
Created Jul 27, 2017
Returns the point where a plane intersects a given line
View findLinePlaneIntersectionCoords.js
/**
* findLinePlaneIntersectionCoords (to avoid requiring unnecessary instantiation)
* Given points p with px py pz and q that define a line, and the plane
* of formula ax+by+cz+d = 0, returns the intersection point or null if none.
*/
function findLinePlaneIntersectionCoords(px, py, pz, qx, qy, qz, a, b, c, d) {
var tDenom = a*(qx-px) + b*(qy-py) + c*(qz-pz);
if (tDenom == 0) return null;
var t = - ( a*px + b*py + c*pz + d ) / tDenom;
@Cristo86
Cristo86 / android.toolchain.cmake.diff
Created Jun 28, 2017
Changes to make on the android toolchain file to make it work on Windows
View android.toolchain.cmake.diff
+++ b/cmake/android/android.toolchain.cmake
@@ -362,6 +362,7 @@ if( NOT DEFINED ANDROID_NDK_HOST_X64 AND (CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "a
endif()
set( TOOL_OS_SUFFIX "" )
+set( TOOL_OS_CLANG_SCRIPT_SUFFIX "" )
if( CMAKE_HOST_APPLE )
set( ANDROID_NDK_HOST_SYSTEM_NAME "darwin-x86_64" )
set( ANDROID_NDK_HOST_SYSTEM_NAME2 "darwin-x86" )
@@ -369,6 +370,7 @@ elseif( CMAKE_HOST_WIN32 )
View DirsAndNetworkAvailabilityImpl.java
public class CustomApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
// ...
}
private static class DirsImpl implements Dirs {
@Cristo86
Cristo86 / BuildOkHttpClientWithCache1.java
Created Jul 6, 2016
Building an OkHttpClientWithCache v1
View BuildOkHttpClientWithCache1.java
// By https://github.com/newfivefour/BlogPosts/blob/master/android-retrofit2-okhttp3-cache-network-request-offline.md
OkHttpClient client = new OkHttpClient
.Builder()
.cache(new Cache(App.sApp.getCacheDir(), 10 * 1024 * 1024)) // 10 MB
.addInterceptor(new Interceptor() {
@Override public Response intercept(Chain chain) throws IOException {
Request request = chain.request();
if (App.isNetworkAvailable()) {
request = request.newBuilder().header("Cache-Control", "public, max-age=" + 60).build();
} else {
View QuickArray.java
void method() {
// traditional way
Foo.methodThatTakesArrays(new int[]{1,2,3,4,5,6,7,8});
// or..
Foo.methodThatTakesArrays(ai(1,2,3,4,5,6,7,8));
}
/**
* Array of ints
You can’t perform that action at this time.