Skip to content

Instantly share code, notes, and snippets.

View anzfactory's full-sized avatar
:octocat:
Working from home

anz anzfactory

:octocat:
Working from home
View GitHub Profile
@azu
azu / pixiv API.user.js
Created January 5, 2010 13:57
Pixivの検索API叩く
// ==UserScript==
// @name pixiv API
// @namespace http://efcl.info/
// @include http://www.pixiv.net/*
// ==/UserScript==
// API 資料 http://pastie.org/735195
var pxvAPI = "http://iphone.pxv.jp/iphone/"
// 検索結果のオブジェクト
var result = [];
var user = {
@rkumar
rkumar / itunes.sh
Created August 1, 2010 09:23
control iTunes from command line
#!/bin/bash
#
####################################
# iTunes Command Line Control v1.0
# written by David Schlosnagle
# created 2001.11.08
# edit 2010.06.01 rahul kumar
####################################
showHelp () {
@darktable
darktable / MiniJSON.cs
Created November 30, 2011 23:08
Unity3D: MiniJSON Decodes and encodes simple JSON strings. Not intended for use with massive JSON strings, probably < 32k preferred. Handy for parsing JSON from inside Unity3d.
/*
* Copyright (c) 2013 Calvin Rien
*
* Based on the JSON parser by Patrick van Bergen
* http://techblog.procurios.nl/k/618/news/view/14605/14863/How-do-I-write-my-own-parser-for-JSON.html
*
* Simplified it so that it doesn't throw exceptions
* and can be used in Unity iPhone with maximum code stripping.
*
* Permission is hereby granted, free of charge, to any person obtaining
@yamaya
yamaya / xcode-clang-vers
Last active May 20, 2024 16:55
Xcode clang version record
# Xcode 4.3.3
Apple clang version 3.1 (tags/Apple/clang-318.0.61) (based on LLVM 3.1svn)
Target: x86_64-apple-darwin11.4.0
Thread model: posix
# Xcode 4.3.2
Apple clang version 3.1 (tags/Apple/clang-318.0.58) (based on LLVM 3.1svn)
Target: x86_64-apple-darwin11.4.0
Thread model: posix
@STAR-ZERO
STAR-ZERO / FontFitTextView.java
Created June 15, 2012 03:18
【Android】横幅に合わせてテキストサイズを調整するTextView
import android.content.Context;
import android.graphics.Paint;
import android.util.AttributeSet;
import android.util.TypedValue;
import android.widget.TextView;
/**
* サイズ自動調整TextView
*
*/
@adamawolf
adamawolf / Apple_mobile_device_types.txt
Last active May 23, 2024 15:50
List of Apple's mobile device codes types a.k.a. machine ids (e.g. `iPhone1,1`, `Watch1,1`, etc.) and their matching product names
i386 : iPhone Simulator
x86_64 : iPhone Simulator
arm64 : iPhone Simulator
iPhone1,1 : iPhone
iPhone1,2 : iPhone 3G
iPhone2,1 : iPhone 3GS
iPhone3,1 : iPhone 4
iPhone3,2 : iPhone 4 GSM Rev A
iPhone3,3 : iPhone 4 CDMA
iPhone4,1 : iPhone 4S
@jyukutyo
jyukutyo / gist:3214543
Created July 31, 2012 07:39
HttpClient 4でリクエストボディに画像のバイナリを書きこんでpostする
String url = "https://...";
URIBuilder builder = null;
try {
builder = new URIBuilder(url);
builder.addParameter("param", "テスト");
HttpClient client = new DefaultHttpClient();
HttpPost post = new HttpPost(builder.build());
byte[] bytes = IOUtils.toByteArray(Thread.currentThread().getContextClassLoader().getResource("1.jpg"));
@STAR-ZERO
STAR-ZERO / gist:3413415
Created August 21, 2012 08:13
【Android】画像を縮小して読み込み、画像リサイズ
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Matrix;
/**
* 画像変換クラス
*
*/
public class BitmapUtil {
@teppeihomma
teppeihomma / gist:3522079
Created August 30, 2012 03:42
glReadPixelsからBitmapへの画像取得
// ByteBufferに読み込み
ByteBuffer buffer = ByteBuffer.allocateDirect(width * height * 4);
gl10.glReadPixels(0, 0, width, height, GL10.GL_RGBA, GL10.GL_UNSIGNED_BYTE, buffer);
// 上下逆なので、上下反転
byte[] tmp1 = new byte[width * 4];
byte[] tmp2 = new byte[width * 4];
int h = (int) height / 2;
for (int y = 0; y < h; y++) {
buffer.position(y * width * 4);
using UnityEngine;
using System;
using System.Collections;
using System.Collections.Generic;
struct Triangle {
public int p1;
public int p2;
public int p3;
public Triangle(int point1, int point2, int point3) {