Skip to content

Instantly share code, notes, and snippets.

View Santarh's full-sized avatar

Masataka SUMI Santarh

  • Tokyo, Japan
View GitHub Profile
@Santarh
Santarh / main.c
Created January 26, 2012 16:37
Excel Column Name
#include <stdio.h>
#include <math.h>
#define AtoZ 26
#define ASCII_A 65
int calc( char* c, int* sum )
{
if ( *c == '\0' )
{
@Santarh
Santarh / main.m
Created February 14, 2012 12:10
Getting BitmapData from Image on Cocoa
- (CGImageRef) loadImageWithPath:(NSString*)path
{
NSImage* image = [NSImage imageNamed:path];
return [image CGImageForProposedRect:nil context:nil hints:nil];
}
@Santarh
Santarh / main.cpp
Created February 23, 2012 05:07
Yaba code
#include <vector>
class Foo;
class Manage
{
private:
std::vector<Foo> m_vec;
public:
@Santarh
Santarh / main2.rb
Created February 28, 2012 16:51
何かのダウンロード
require "net/http"
$host_ip = "255.255.255.0"
$directory = "/h/f/p/g/"
$extension = ".jpg"
# サーバへの気持ち
$wait_time = 0.5
$type = (1..3).to_a
@Santarh
Santarh / pmd.cpp.diff
Created March 7, 2012 07:43
meshio::pmd
*** ./new_pmd.cpp 2011-12-16 00:32:02.000000000 +0900
--- ./pmd.cpp 2012-03-07 16:28:07.000000000 +0900
***************
*** 411,417 ****
for(int i=0; i<10; ++i){
char toon[100];
sprintf(toon, "toon%02d.bmp", i+1);
! toon_textures[i]=toon;
}
}
using UnityEngine;
using System.Collections;
public class TestTexture : MonoBehaviour
{
// Use this for initialization
void Start ()
{
}
@Santarh
Santarh / frag.glsl
Created April 16, 2012 03:57
Raymarching - Simple sphere
#ifdef GL_ES
precision mediump float;
#endif
uniform float time;
uniform vec2 mouse;
uniform vec2 resolution;
vec3 eye_pos = vec3( 0.0, 0.0, -5.0 );
vec3 target_pos = vec3( 0.0, 0.0, 0.0 );
@Santarh
Santarh / fragment.c
Created April 17, 2012 18:20
Blue Earth
#ifdef GL_ES
precision mediump float;
#endif
uniform float time;
uniform vec2 mouse;
uniform vec2 resolution;
vec3 y_up = vec3( 0.0, 1.0, 0.0 );
vec3 eye_pos = vec3( 0.0, 0.0, -3.0 );
@Santarh
Santarh / fragment.c
Created April 17, 2012 19:19
raymarching!
#ifdef GL_ES
precision mediump float;
#endif
uniform float time;
uniform vec2 mouse;
uniform vec2 resolution;
vec3 y_up = vec3( 0.0, 1.0, 0.0 );
vec3 eye_pos = vec3( 0.0, 0.0, -3.0 );
@Santarh
Santarh / fragment.c
Created April 18, 2012 06:12
raymarching
#ifdef GL_ES
precision mediump float;
#endif
uniform float time;
uniform vec2 mouse;
uniform vec2 resolution;
vec3 y_up = vec3( 0.0, 1.0, 0.0 );
vec3 eye_pos = vec3( 0.0, 0.0, -3.0 );