Skip to content

Instantly share code, notes, and snippets.

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

kidapu kidapu

:octocat:
On vacation
  • 11:20 (UTC +09:00)
View GitHub Profile
@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 / 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 / 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 / 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 / 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 / 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 / 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 / main.moon
Last active February 9, 2016 18:28
the way to require class in moonscript. http://www.luafaq.org/#T8.1.5
test = require "test"
t = test.TestClass()
t\update()
t\print()
print t.val
@kidapu
kidapu / main.moon
Last active February 9, 2016 18:26
the way to require class in moonscript (this syntax is depreciated)
require "test"
a = test.AClass()
a\update()
a\update()
a\print()