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
bool VideoPlayerScene::init() { | |
if (!Scene::init()) {return false;} | |
auto visibleSize = Director::getInstance()->getVisibleSize(); | |
auto videoPlayer = cocos2d::experimental::ui::VideoPlayer::create(); | |
videoPlayer->setContentSize(visibleSize); | |
videoPlayer->setPosition(Vec2(visibleSize.width/2, visibleSize.height / 2)); | |
videoPlayer->setEnabled(false); | |
videoPlayer->setKeepAspectRatioEnabled(true); |
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
// | |
// Created by gin0606 on 2014/07/07. | |
// | |
#include "UIWidget.h" | |
#ifndef __widget_util_H_ | |
#define __widget_util_H_ |
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
// Hoge::FugaEnumを前方宣言したい | |
class Hoge : public TemplateClass<Hoge, FugaEnum> { | |
public: | |
enum class FugaEnum { | |
FOO, | |
} | |
} |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<project name="custom_rules" default="help"> | |
<target name="-post-compile"> | |
<javah classpath="./path/to/classes" destdir="./path/to/jni/"> | |
<class name="me.gin0606.ClassName" /> | |
</javah> | |
</target> | |
</project> |
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 'octokit' | |
USER_NAME = ENV['NIPPO_GITHUB_USER_NAME'] | |
client = Octokit::Client.new(login: USER_NAME, access_token: ENV['NIPPO_GITHUB_API_TOKEN']) | |
events = [] | |
events.concat client.user_events(USER_NAME) | |
events.concat client.user_public_events(USER_NAME) | |
activities = {} |
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
main = putStrLn "Project Euler" | |
p1 :: Integral a => a -> a | |
p1 n = sum [x | x <- [1..n-1], mod x 3 == 0 || mod x 5 == 0] | |
p2 :: Integer -> Integer | |
p2 n = sum $ takeWhile (<=n) [x | x <- fibonacci, even x] | |
p3 :: Integral a => a -> a | |
p3 n = maximum $ primeFactorization n |
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
primeFactorization :: (Integral a) => a -> [a] | |
primeFactorization 0 = [] | |
primeFactorization 1 = [] | |
primeFactorization 2 = [2] | |
primeFactorization x = | |
let fstf = firstFactor x | |
xx = (div x fstf) | |
in [fstf] ++ primeFactorization xx | |
firstFactor :: Integral a => a -> a |
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
NSURL *receiptURL = [[NSBundle mainBundle] appStoreReceiptURL]; | |
NSData *receipt = [NSData dataWithContentsOfURL:receiptURL]; | |
NSString *receiptString = [receipt base64EncodedStringWithOptions: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
<target name="-package-resources" depends="-crunch"> | |
<exec executable="${aapt}" failonerror="true"> | |
<arg value="package" /> | |
<arg value="-f" /> | |
<arg value="--auto-add-overlay" /> | |
<arg value="-M" /> | |
<arg path="${basedir}/AndroidManifest.xml" /> | |
<arg value="-S" /> | |
<arg path="${resource.absolute.dir}" /> | |
<arg value="-I" /> |
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
auto url = "任意の画像のURL"; | |
auto request = new cocos2d::network::HttpRequest(); | |
request->setUrl(url); | |
request->setRequestType(cocos2d::network::HttpRequest::Type::GET); | |
request->setResponseCallback([this, url](cocos2d::network::HttpClient *, cocos2d::network::HttpResponse *response) { | |
if (!response->isSucceed()) {return;} | |
auto responseData = response->getResponseData(); | |
auto bytes = reinterpret_cast<unsigned char *>(&(responseData->front())); |