This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <GL/glut.h> | |
void display(void) | |
{ | |
glEnable(GL_DEPTH_TEST); | |
glEnable(GL_LIGHTING); | |
glEnable(GL_LIGHT0); | |
glClearColor(0.0, 0.0, 1.0, 1.0); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'opengl' | |
$rot = 0.0 | |
def display | |
glEnable(GL_DEPTH_TEST) | |
glEnable(GL_LIGHTING) | |
glEnable(GL_LIGHT0) | |
glClearColor(0.0, 0.0, 1.0, 1.0) | |
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/ruby | |
require 'aws-sdk' | |
require 'yaml' | |
# Get informations of the instance. | |
instance_id = `curl -s http://169.254.169.254/latest/meta-data/instance-id` | |
endpoint = ['ec2', `curl -s http://169.254.169.254/latest/meta-data/public-hostname`.split('.')[1], 'amazonaws.com'].join('.') | |
ip = `curl -s http://169.254.169.254/latest/meta-data/public-ipv4` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
uniform sampler2D tex; | |
float M_2PI = 6.283185307179586; | |
float SQRT2 = 1.4142135623730951; | |
void main() | |
{ | |
float x = (gl_TexCoord[0].x - 0.5); | |
float y = (gl_TexCoord[0].y - 0.5); | |
float r = sqrt(x*x+y*y); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// GPUImageLittlePlanetProjectionFilter.h | |
// | |
// Created by Toshiyuki Suzumura on 2013/07/02. | |
// Copyright (c) 2013 Toshiyuki Suzumura. All rights reserved. | |
// | |
#import "GPUImageFilter.h" | |
@interface GPUImageLittlePlanetProjectionFilter : GPUImageFilter |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef __simd_bilinear_sampler__ | |
#define __simd_bilinear_sampler__ | |
#include <immintrin.h> | |
class BilinearSampler { | |
protected: | |
const uint8_t* _pixels; | |
int _rowInBytes; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
class ModifyPath | |
def initialize(exe) | |
@exe = exe | |
@dylibs = `otool -L #{exe}`.each_line.map{|line| | |
$1 if line=~%r{\t([^/@].+\.dylib) .*$} | |
}.compact.delete_if{|dy| | |
File.basename(dy)==File.basename(exe) or !File.exist?(File.basename(exe)) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#from peewee import * | |
#import pymysql | |
import peewee | |
# 'id' to 'BIGINT AUTO_INCREMENT' | |
peewee.MySQLDatabase.field_overrides['primary_key'] = 'BIGINT AUTO_INCREMENT' | |
db = peewee.MySQLDatabase( | |
database='peewee_development', | |
user='root', | |
password='', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import commands | |
class MyIP: | |
def rawips(self): | |
cmd = "awk 'NR!=1 { split($2,arr,\":\"); print arr[1] }' /proc/net/tcp|sort|uniq" | |
return commands.getoutput(cmd).split("\n") | |
def raw2str(self, raw): | |
n = [int(raw[n:n+2],16) for n in [6,4,2,0]] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env rackup | |
# encoding: UTF-8 | |
=begin | |
# start application | |
$ mkdir files | |
$ ./fileUploader.ru | |
# upload | |
$ curl localhost:9292/files -F comment="hello,world" -F "[email protected];type=image/jpg" |
OlderNewer