Skip to content

Instantly share code, notes, and snippets.

View kidapu's full-sized avatar
:octocat:
On vacation

kidapu kidapu

:octocat:
On vacation
  • 17:34 (UTC +09:00)
View GitHub Profile
@kidapu
kidapu / stringFormat.cpp
Created February 13, 2016 08:26
C++ string format つくりたい
// test
string stringFormat(const char *format, ...)
{
va_list va;
va_start(va, format);
char buffer[150];
vsprintf(buffer, format, va);
va_end(va);
return (string)buffer;
}
@kidapu
kidapu / ofApp.h
Created February 23, 2016 11:50
base64 decode + encode sample
// reference : https://gist.github.com/satoruhiga/1687325
#pragma once
static int WIDTH = 300;
static int HEIGHT = 300;
#include "ofMain.h"
#include "Poco/Base64Encoder.h"
@kidapu
kidapu / neural-style-test.js
Last active April 17, 2016 16:56
neural-style-test.js
var _child = require('child_process');
// convert
init();
function init()
{
// safety success
var args = [
"neural_style.lua",
"-style_image" , "outputs/kida/jiburi.jpg",
@kidapu
kidapu / settimeout.cpp
Last active May 14, 2016 14:17
of_settimeout_sample.cpp
#pragma once
#include "ofMain.h"
#include <functional>
#include <chrono>
#include <future>
#include <cstdio>
// reference : https://stackoverflow.com/questions/14650885/how-to-create-timer-events-using-c-11/14665230#14665230
@kidapu
kidapu / C++11_openframeworks_tween_util_class.h
Created May 14, 2016 20:20
C++11_openframeworks_tween_util_class
#include "ofMain.h"
class Utils
{
public:
static void tween(float start_val, float end_val, int interval, std::function<void(float)> task, std::function<void()> complete = [](){})
{
auto start_time = std::chrono::system_clock::now();
std::thread([start_val, end_val, interval, start_time, task, complete]() {
while(true)
@kidapu
kidapu / hexUtils.cpp
Created June 7, 2016 11:15
floatやintから16進数化したstringが得られる。あんまり使うことなさそう。
class Utils
{
private:
template< typename T >
static std::string IntToHex( T i )
{
std::stringstream stream;
stream
<< std::setfill ('0')
@kidapu
kidapu / movie-cut.js
Created September 26, 2016 07:43
ffmpegで動画を繰り刻む君.txt
// require
var _exec = require('child_process').execSync;
var _util = require('util');
// static const
var _scale = 1.0;
var _fps = 30;
var _input_path = "./src/test.mov";
var _output_format ="./dest/test%d.mov"
@kidapu
kidapu / movie-cut.js
Created September 26, 2016 07:43
ffmpegで動画を繰り刻む君.txt
// require
var _exec = require('child_process').execSync;
var _util = require('util');
// static const
var _scale = 1.0;
var _fps = 30;
var _input_path = "./src/test.mov";
var _output_format ="./dest/test%d.mov"
@kidapu
kidapu / convert-mp4.sh
Last active December 2, 2016 06:35
convert-mp4
#!/bin/sh
echo "Hello"
for file in *.m4v
do
echo "-------------"
echo "CONVERT $file"
ffmpeg -vcodec "h264" -i "$file" "./output/$file.mp4"
# ffmpeg -i "$file" -vf scale=960:540 "./output/$file.mp4"
@kidapu
kidapu / root-ro
Last active April 28, 2020 04:09 — forked from sbonfert/root-ro
Read-only Root-FS with overlayfs for Raspian
#!/bin/sh
#
# Read-only Root-FS for Raspian
#
# Modified 2016 by Stefan Bonfert to make it compatible with Raspbian
# Jessie (vanilla).
#
# Modified 2015 by Pascal Rosin to work on raspian-ua-netinst with
# overlayfs integrated in Linux Kernel >= 3.18.
#