Skip to content

Instantly share code, notes, and snippets.

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

Bruno vrunoa

:electron:
Se dice: A TO MI CO
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 / 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 / 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
}
@vrunoa
vrunoa / appium-unlock.log
Created January 24, 2017 16:50
Appium pattern unlock failing log
./node_modules/.bin/gulp transpile && ./node_modules/.bin/mocha --compilers js:babel-core/register -t 0 test/functional/driver-e2e-specs.js
[08:43:15] Using gulpfile ~/Sauce/appium-android-driver/gulpfile.js
[08:43:16] Starting 'transpile'...
[08:43:30] Finished 'transpile' after 15 s
createSession
dbug AndroidDriver AndroidDriver version: 1.10.39
WARN BaseDriver The following capabilities were provided, but are not recognized by appium: unlockType, unlockKey.
info BaseDriver Session created with session id: 9d026d3f-7402-4335-a28e-6f030a80770f
@vrunoa
vrunoa / processing.py
Created June 22, 2016 19:02
Converting android m4a to wav in python
for i, m4a_buffer in enumerate(m4a_buffers):
f = tempfile.NamedTemporaryFile(dir=voice_datadir, suffix="."+input_audio_extension, prefix="%s_%d"%(username,i), delete=True)
f.write(m4a_buffers[i])
f.seek(0, os.SEEK_END)
chunk = AudioSegment.from_file(f.name, "mp4")
chunk.export("%s_%d.wav"%(username,i), format="wav")