Skip to content

Instantly share code, notes, and snippets.

@satoruhiga
satoruhiga / billboard.h
Created July 17, 2011 09:17
OpenGL Billboard
// http://marina.sys.wakayama-u.ac.jp/~tokoi/?date=20110221
inline void billboard()
{
GLfloat m[16];
glGetFloatv(GL_MODELVIEW_MATRIX, m);
float inv_len;
m[8] = -m[12];
@satoruhiga
satoruhiga / chrome search engine settings
Created May 25, 2011 18:40
my chrome search engine settings
Google ja:
http://www.google.com/search?lr=lang_ja&q=%s
Google en:
http://www.google.com/search?lr=lang_en&q=%s
oF forum:
http://www.google.com/search?sitesearch=http%3A%2F%2Fforum.openframeworks.cc&q=%s
C++ reference:
http://www.google.com/search?sitesearch=http%3A%2F%2Fwww.cppreference.com/wiki/&q=%s
C++ reference(ja):
http://www.google.com/search?sitesearch=http%3A%2F%2Fwww.cppreference.com/wiki/jp/&q=%s
@satoruhiga
satoruhiga / mov2gif.py
Last active August 24, 2022 08:43
convert mov to gif animation
#!/usr/bin/env python
'''
DEPENDENCIES:
$ brew install ffmpeg
$ brew install imagemagick
$ python ./mov2gif.py input.mov output.gif 15
'''
@satoruhiga
satoruhiga / zcompress.cpp
Created January 21, 2012 16:43
compress with zlib
#include <zlib.h>
bool zcompress(const string& input, string& output)
{
z_stream z;
z.zalloc = Z_NULL;
z.zfree = Z_NULL;
z.opaque = Z_NULL;
@satoruhiga
satoruhiga / .gitignore
Last active October 6, 2016 10:48
.gitignore
.svn
.hg
.cvs
# osx
.DS_Store
.AppleDouble
.LSOverride
Icon
*.app
@satoruhiga
satoruhiga / ofxAutoSaveParam.h
Last active April 3, 2016 14:59
ofxAutoSaveParam.h
#pragma once
/*
USAGE:
ofxAutoSaveParam param;
class ofApp {
public:
@satoruhiga
satoruhiga / Mmap.hpp
Last active April 3, 2016 14:47
Mmap.hpp
#pragma once
#include <sys/stat.h>
#include "ofMain.h"
class Mmap
{
public:
@satoruhiga
satoruhiga / getCurrentFov.cpp
Last active April 3, 2016 14:47
getCurrentFov.cpp
float getCurrentFov()
{
GLfloat m[16];
GLint viewport[4];
glGetFloatv(GL_PROJECTION_MATRIX, m);
glGetIntegerv(GL_VIEWPORT, viewport);
float aspect = (float)viewport[2] / viewport[3];
@satoruhiga
satoruhiga / Spectrum.h
Last active April 3, 2016 14:46
Spectrum.h
#pragma once
#include "ofMain.h"
class Spectrum
{
public:
Spectrum() : buffer_size(100), x_scale(0.001) {}
@satoruhiga
satoruhiga / get_finder_path.sh
Last active April 3, 2016 14:46
get_finder_path.sh
#!/bin/sh
/usr/bin/osascript -e 'tell application "Finder" to get POSIX path of (target of window 1 as string)'