Skip to content

Instantly share code, notes, and snippets.

View vrunoa's full-sized avatar
:electron:
Se dice: A-TO-MICO

Bruno vrunoa

:electron:
Se dice: A-TO-MICO
View GitHub Profile
/**
* Hide the addressbar on ios & android devices
* https://gist.github.com/yckart/5609969
*
* Based on the work from Nate Smith
* @see https://gist.github.com/nateps/1172490
*
* Copyright (c) 2013 Yannick Albert (http://yckart.com)
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php).
* 2013/07/10
@vrunoa
vrunoa / gist:47b9d84fb53a7a03e09a
Last active August 29, 2015 14:23
ES6 default export value ?

I've been using babel on a few projects, and on my last project I got myself with this question;

I have a scan function where I want to set 2 default values

export default function scan({
  tmpFolder = "./tmp", 
  verbose = false
}){
// function body
}
@vrunoa
vrunoa / unlink.py
Created November 24, 2015 00:27
Unlink in python
@vrunoa
vrunoa / build.gradle
Last active January 14, 2016 20:12
Create a task on gradle to get android project versionName from cli
apply plugin: 'com.android.library'
apply plugin: Version
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
minSdkVersion 10
targetSdkVersion 23
@vrunoa
vrunoa / build.gradle
Created January 19, 2016 09:13
Running appium test from gradle
apply plugin: 'com.android.application'
apply plugin: 'maven'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.urucas.appiumtests"
minSdkVersion 10
@vrunoa
vrunoa / shell.log
Last active January 21, 2016 23:21
Weird or i'm doing something wrong ?
➜ logcatIO git:(master) ✗ npm run build
> logcatio@0.0.3 build /Users/vruno/Documents/Urucas/Node/logcatIO
> babel lib/ --out-dir dist/
lib/index.js -> dist/index.js
➜ logcatIO git:(master) ✗ cat dist/index.js
import socketio from 'socket.io';
import semafor from 'semafor';
@vrunoa
vrunoa / logcat.log
Last active January 24, 2016 20:37
Compass Card fareboot log
Compass card (NXP MIFARE DESFire EV1)
application > 1 0 0
file no > 0
read data > 90 bd 0 0 7 0 0 0 0 0 0 0 0
result > 91 ae
Clipper card(MIFARE DESFire)
application > 90 11 f2
file no > 1
read data > 90 bd 0 0 7 1 0 0 0 0 0 0 0
@vrunoa
vrunoa / jniTest.cpp
Last active June 3, 2016 21:42
cv::cvtColor fail
// trying to convert Luv image to BGR
JNIEXPORT jboolean JNICALL Java_com_test_run(JNIEnv* env, jobject thiz, jlong data) {
__android_log_write(ANDROID_LOG_INFO, "TEST", "run");
if(data == 0) {
__android_log_write(ANDROID_LOG_ERROR, "TEST", "empty jlong mat");
return false;
}
@vrunoa
vrunoa / jniChar2jbyteArray.cpp
Last active August 25, 2022 15:12
Convertng char* to jbyteArray the right way
JNIEXPORT jbyteArray JNICALL Java_com_urucas_test_getframes(JNIEnv* env, jobject thiz) {
__android_log_write(ANDROID_LOG_INFO, "Test", "getting frames");
char* frame;
int len;
processor->getFrames(&frame, &len);
jbyteArray arr = env->NewByteArray(len);
env->SetByteArrayRegion(arr, 0, len, reinterpret_cast<jbyte*>(&frame));
delete processor;
return arr;
}
@vrunoa
vrunoa / chunkBuffer.java
Last active June 18, 2016 00:31
chunkBuffer.java
public byte[] chunk(ByteBuffer buffer) {
byte[] finalBuffer = new byte[buffer.limit()-buffer.remaining()];
ByteBuffer target = ByteBuffer.wrap(finalBuffer);
target.order(ByteOrder.LITTLE_ENDIAN);
target.put(buffer.array(), 0, buffer.position());
retur finalBuffer
}