Skip to content

Instantly share code, notes, and snippets.

View ruslo's full-sized avatar

Ruslan Baratov ruslo

  • Bali
  • 22:35 (UTC +08:00)
View GitHub Profile
#!/bin/bash -e
set -x
gource \
--auto-skip-seconds 0.001 \
--seconds-per-day 0.07 \
--start-position 0.1 \
--user-filter ruslo \
--user-filter ingenue \
@ruslo
ruslo / CMakeList.txt
Created June 13, 2016 09:30
Set c++11
string(COMPARE NOTEQUAL "${CMAKE_TOOLCHAIN_FILE}" "" has_toolchain)
if(has_toolchain)
set(CMAKE_CXX_STANDARD_REQUIRED YES)
set(CMAKE_CXX_STANDARD 11)
endif()
@ruslo
ruslo / qtox-launch.log
Created February 5, 2016 10:35
Ubuntu 14.04 qTox launching log
[17:32:17.382] src/persistence/settings.cpp:121 : Debug: "Loading settings from /home/xxxxx/.config/tox/qtox.ini"
[17:32:17.384] src/ipc.cpp:46 : Debug: Our global IPC ID is ...
[17:32:17.384] src/ipc.cpp:64 : Debug: Attaching to the global shared memory
[17:32:17.384] src/ipc.cpp:259 : Debug: Previous owner timed out, taking ownership ... -> ...
[17:32:17.384] src/main.cpp:170 : Debug: built on: 09:55:01 Feb 4 2016 ( ... )
[17:32:17.385] src/main.cpp:171 : Debug: commit: ...
[17:32:17.385] src/persistence/profile.cpp:86 : Debug: Loading tox save "/home/xxxxx/.config/tox/xxxxx.tox"
[17:32:17.385] src/persistence/settings.cpp:354 : Debug: "Saving global settings at /home/xxxxx/.config/tox/qtox.ini"
[17:32:17.388] src/persistence/settings.cpp:295 : Debug: Loading personal settings from "/home/xxxxx/.config/tox/xxxxx.ini"
#!/bin/bash -e
rm -rf Boo Bar
git clone https://github.com/forexample/temp-boo Boo
git clone https://github.com/forexample/temp-bar Bar
export HUNTER_ROOT="`pwd`/_HUNTER"
### Boo build with clean Hunter
@ruslo
ruslo / CMakeLists.txt
Created December 10, 2015 12:17
Example of breaking shell operators by `LOG_CONFIGURE 1`
cmake_minimum_required(VERSION 3.0)
project(Foo)
include(ExternalProject)
ExternalProject_Add(
Foo
DOWNLOAD_COMMAND ""
CONFIGURE_COMMAND "${CMAKE_COMMAND}" -E echo "cd .." > configure.sh
COMMAND sh configure.sh
@ruslo
ruslo / gist:04d8993800ee78513d1c
Last active December 3, 2015 23:09
Example of impossibility of patching C++ string literal after compiler do his job
> cat boo.cpp
// function will return some enum with information about resources
int have_resources_in_install() {
// want to patch this string AFTER compile stage done
const char* path = "non empty string";
if (path[0] != '\0') {
return 0x123;
}
If you pass "/usr/local" output will be (nice):
----------
/usr/local
----------
If you pass "/home/username", output will be (nice):
--------------
/home/username
I/CamActivity(21269): releasing ogles_gpgpu
W/Adreno-ES20(21269): <core_glDeleteProgram:590>: GL_INVALID_VALUE
E/libEGL (21269): validate_display:254 error 3008 (EGL_BAD_DISPLAY)
F/libc (21269): Fatal signal 11 (SIGSEGV) at 0xfffffffe (code=1), thread 21269 (gvideoprocdroid)
I/DEBUG ( 212): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG ( 212): pid: 21269, tid: 21269, name: gvideoprocdroid >>> ogles_gpgpu.examples.ogvideoprocdroid <<<
I/DEBUG ( 212): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr fffffffe
I/DEBUG ( 212):
I/DEBUG ( 212): backtrace:
I/DEBUG ( 212): #00 pc 00011444 /system/lib/libc.so (dlfree+55)
/**
* Callback from SurfaceTexture.OnFrameAvailableListener. Is called each time a new
* camera frame for the SurfaceTexture is available.
*/
@Override
public void onFrameAvailable(SurfaceTexture) {
synchronized (lock) {
frameNotification = true;
lock.notify();
}
@ruslo
ruslo / gist:4be4a3e3381dd8488771
Last active October 2, 2015 15:52
Process camera frames in parallel manner
/**
* Callback from SurfaceTexture.OnFrameAvailableListener. Is called each time a new
* camera frame for the SurfaceTexture is available.
*/
@Override
public void onFrameAvailable(SurfaceTexture) {
synchronized (lock) {
frameAvailable = true;
lock.notify();
}