Skip to content

Instantly share code, notes, and snippets.

Avatar

Satoru Higa satoruhiga

View GitHub Profile
@satoruhiga
satoruhiga / mov2gif.py
Last active Dec 6, 2019
convert mov to gif animation
View mov2gif.py
#!/usr/bin/env python
'''
DEPENDENCIES:
$ brew install ffmpeg
$ brew install imagemagick
$ python ./mov2gif.py input.mov output.gif 15
'''
@satoruhiga
satoruhiga / zcompress.cpp
Created Jan 21, 2012
compress with zlib
View zcompress.cpp
#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;
View .gitignore
.svn
.hg
.cvs
# osx
.DS_Store
.AppleDouble
.LSOverride
Icon
*.app
@satoruhiga
satoruhiga / ofxAutoSaveParam.h
Last active Apr 3, 2016
ofxAutoSaveParam.h
View ofxAutoSaveParam.h
#pragma once
/*
USAGE:
ofxAutoSaveParam param;
class ofApp {
public:
View Mmap.hpp
#pragma once
#include <sys/stat.h>
#include "ofMain.h"
class Mmap
{
public:
View 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];
View 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 Apr 3, 2016
get_finder_path.sh
View get_finder_path.sh
#!/bin/sh
/usr/bin/osascript -e 'tell application "Finder" to get POSIX path of (target of window 1 as string)'
@satoruhiga
satoruhiga / configure_osx_32bit
Last active Apr 3, 2016
configure_osx_32bit
View configure_osx_32bit
#!/bin/bash
ARCH="-arch i386"
SDK="-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk"
SDKLIB="-Wl,-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk"
export MACOSX_DEPLOYMENT_TARGET="10.7"
export CFLAGS="$ARCH $SDK -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET"
View BAD_TUNE_TV.fs
/*{
"DESCRIPTION": "BAD_TUNE_TV",
"CREDIT": "by satoruhiga",
"CATEGORIES": [
"GLSL FX"
],
"INPUTS": [
{
"NAME": "inputImage",
"TYPE": "image"