Skip to content

Instantly share code, notes, and snippets.

@wararyo
wararyo / IR.h
Last active August 29, 2015 13:57
IR library(Send Only/NEC format)
/*
* IR.h
*
* Created: 2014/03/30 22:35:21
* Author: wararyo
*/
#ifndef IR_H_
#define IR_H_
#include <avr/io.h>
@wararyo
wararyo / opengl_glfw_test.cpp
Last active August 29, 2015 14:16
いろんな所から拝借して組み合わせたコードです。
#define GLFW_INCLUDE_GLU
#include <gl/glfw3.h>
#include <iostream>
#include <cstdlib>
#include <string>
int main()
{
GLFWwindow* window;
@wararyo
wararyo / hellovg.c
Created March 12, 2015 11:14
test code for OpenVG on Raspberry Pi using https://github.com/ajstarks/openvg
// first OpenVG program
// Anthony Starks ([email protected])
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <VG/openvg.h>
#include <VG/vgu.h>
#include "fontinfo.h"
#include "shapes.h"
#include "MTLmr3m.inc"
@wararyo
wararyo / characters.c
Created March 13, 2015 05:08
ASCII文字、ひらがなカタカナ、JIS第一水準の漢字をひたすら並べた
int CHARACTERS[] = {
0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F,0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x3001,0x3002,0x3003,0x3004,0x20,0x20,0x3005,0x3006,0x3007,0x3008,0x3009,0x300A,0x300B,0x300C,0x300D,0x300E,0x300F,0x3010,0x3011,0x3012,0x3013,0x3014,0x3015,0x3016,0x3017,0x3018,0x3019,0x301A,0x301B,0x301C,0x301D,0x301E,0x301F,0x3020,0x3021,0x3022,0x3023,0x3024,0x3025,0x3026,0x3027,0x3028,0x3029,0x3030,0x3031,0x3032,0x3033,0x3034,0x3035,0x3036,0x3037,0x3038,0x3039,0x303A,0x303B,0x3040,0x3041,0x3042,0x3043,0x3044,0x3045,0x3046,0x3047,0x3048,0x3049,0x304A,0x304B,0x304C,0x304D,0x304E,0x304F,0x3050,0x3051,0x3052,0x3053,0
@wararyo
wararyo / myevernote.py
Last active February 4, 2017 12:50
Evernote for Python
from evernote.api.client import EvernoteClient
import evernote.edam.type.ttypes as Types
from evernote.edam.error import ttypes as Errors #この行が正しく機能してるかは怪しい
import os
import hashlib
import mimetypes
import binascii
dev_token = "your developer token"
client = EvernoteClient(token=dev_token, sandbox=True)
@wararyo
wararyo / olympic.cpp
Last active October 17, 2015 11:50
オリンピックの図形を描く
#define GLFW_INCLUDE_GLU
#define _USE_MATH_DEFINES //M_PIを使うためのおまじない
#include <gl/glfw3.h> //某大の教授が開発したっぽいChinouGLとやらの代わりにGLFWを使う(ChinouGLはググっても情報が出てこなかった)
#include <iostream>
#include <cstdlib>
#include <cmath>
#include <string>
#define LENGTH_OF(TS) (sizeof(TS) / sizeof(TS[0]))//配列のサイズを求める
@wararyo
wararyo / Sunaba.sublime-syntax
Last active May 18, 2018 04:01
Sublime Syntax for Sunaba
%YAML 1.2
---
# See http://www.sublimetext.com/docs/3/syntax.html
name: Sunaba
file_extensions:
- sunaba
- snb
- sunaba.txt
- snb.txt
scope: source.sunaba
@wararyo
wararyo / CHUNITHM.sunaba.txt
Created May 25, 2018 07:05
3D Rhythm Game for Sunaba
/*
#####################################
# CHUNITHMっぽそうでCHUNITHMっぽくない、#
# すこしCHUNITHMっぽい音ゲー ###########
#####################################
# コードの概要 (行頭の数字はコード中のだいたいの位置)
60 Settings ゲームプレイに直接関わる変数群
Camera カメラ設定
@wararyo
wararyo / _header.scss
Last active January 10, 2019 05:55
Twitter in Eclair HP
.header-banner {
display: block;
margin-bottom: 16px;
box-shadow: 0 2px 4px rgba($black, .2);
> img {
width: 240px;
height: 80px;
box-shadow: 0 2px 4px rgba(0,0,0,.2);
border-radius: 2px;
@wararyo
wararyo / midiToSunaba.js
Created February 9, 2019 19:26
MIDIファイルをCHUNITHM.sunaba.txtで使える音楽データに変換します。
var resolution = 192 // MIDIファイルの分解能 四分音符の長さ
var sunaba_spanY = 1152 // Sunabaでの一小節の長さ
var midiFileParser = require('midi-file-parser');
var file = require('fs').readFileSync('Music2.mid', 'binary')
var midi = midiFileParser(file);
var Generate = function(noteList){