Skip to content

Instantly share code, notes, and snippets.

@tzutalin
tzutalin / clDeviceQuery.cpp
Last active April 16, 2023 19:02
Query OpenCL devices
/* Copyright 1993-2009 NVIDIA Corporation. All rights reserved.
Modified by Mark Zwolinski, December 2009
Modified by Robert McGibbon, August 2013
*/
#ifdef __APPLE__
#include <OpenCL/opencl.h>
#else
#include <CL/cl.h>
#endif
#include <stdlib.h>
@tzutalin
tzutalin / timer-c++03.cpp
Last active March 11, 2023 12:25 — forked from gongzhitaao/CppTimer.md
Simple high resolution timer in C++
#include <iostream>
#include <ctime>
class Timer
{
public:
Timer() { clock_gettime(CLOCK_REALTIME, &beg_); }
double elapsed() {
clock_gettime(CLOCK_REALTIME, &end_);
@tzutalin
tzutalin / iterm2-solarized.md
Created June 8, 2018 02:27 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Meslo powerline font + [Powerlevel9k] - (macOS)

Default

Default

Powerlevel9k

Powerlevel9k

@tzutalin
tzutalin / build-android-opencv.sh
Last active October 1, 2022 21:18
Build OpenCV for android
#!/usr/bin/env sh
NDK_ROOT="${1:-${NDK_ROOT}}"
if [ ! -d "${WD}/android-cmake" ]; then
echo 'Cloning android-cmake'
git clone https://github.com/taka-no-me/android-cmake.git
fi
### ABI setup
#ANDROID_ABI=${ANDROID_ABI:-"armeabi-v7a with NEON"}
@tzutalin
tzutalin / ffmpeg.md
Created July 12, 2017 02:25 — forked from v5tech/ffmpeg.md
ffmpeg视频合并、格式转换、截图

使用ffmpeg合并MP4文件

ffmpeg -i "Apache Sqoop Tutorial Part 1.mp4" -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate1.ts
ffmpeg -i "Apache Sqoop Tutorial Part 2.mp4" -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate2.ts
ffmpeg -i "Apache Sqoop Tutorial Part 3.mp4" -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate3.ts
ffmpeg -i "Apache Sqoop Tutorial Part 4.mp4" -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate4.ts
ffmpeg -i "concat:intermediate1.ts|intermediate2.ts|intermediate3.ts|intermediate4.ts" -c copy -bsf:a aac_adtstoasc "Apache Sqoop Tutorial.mp4"
@tzutalin
tzutalin / _readme.md
Created July 28, 2017 05:37 — forked from maxivak/_readme.md
Vagrant with Ubuntu 16.04 in VirtualBox

Setup Ubuntu 16.04 to be used with Vagrant and Virtualbox

Prepare Vagrant box with Ubuntu 16.04

We will use official box "ubuntu/xenial64" and modify it to work with Vagrant.

  • Vagrantfile
@tzutalin
tzutalin / autojump.py
Last active November 6, 2020 07:46
Ranger's settings and plugins
# config/ranger/plugins/autojump.py
import ranger.api
import subprocess
from ranger.api.commands import *
HOOK_INIT_OLD = ranger.api.hook_init
def hook_init(fm):
def update_autojump(signal):
@tzutalin
tzutalin / Log.h
Last active October 9, 2020 00:26
Simple Log.h in C++
#include <iostream>
#include <string>
#include <ctime>
#include <cstdlib>
namespace da{
struct nullstream: std::ostream{
nullstream(): std::ostream(0){}
};
@tzutalin
tzutalin / removeCertainSearchEngine
Last active March 26, 2020 20:43
js script to remove all other search engines in chrome
removedName = ['groupon',
'avg',
'red',
'Jenkins',
'petewarden',
'booking',
'Hudson',
'blog',
'ebay',
@tzutalin
tzutalin / settings.json
Created August 31, 2019 19:18
VSCode Global Settings
{
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/.DS_Store": true,
".idea": true,
"bower_components": true,
"dist": true,
"tmp": true