Skip to content

Instantly share code, notes, and snippets.

View yasuharu519's full-sized avatar
💪

Yasuharu Sawada yasuharu519

💪
View GitHub Profile
@yasuharu519
yasuharu519 / .local.vimrc
Created November 20, 2015 01:11
C++ 補完用の local.vimrc スクリプト
let s:root_dir = expand("<sfile>:p:h")
let g:marching_include_paths = [
\ s:root_dir . "/deps/cocos2d-x/cocos",
\ s:root_dir . "/deps/cocos2d-x/cocos/platform",
\ s:root_dir . "/deps/cocos2d-x/cocos/platform/apple",
\ s:root_dir . "/deps/cocos2d-x/cocos/platform/desktop",
\ s:root_dir . "/deps/cocos2d-x/cocos/platform/mac",
\ s:root_dir . "/deps/cocos2d-x/external/glfw3/include/mac",
\ s:root_dir . "/deps/cocos-ui/include",
\ s:root_dir . "/deps/clay/include",
@yasuharu519
yasuharu519 / docker-comopse.yml
Last active October 22, 2015 04:20
docker-hubot
# redis
redis:
image: redis
expose:
- "6379"
# hubot
hubot:
build: .
links:
- redis:redis
@yasuharu519
yasuharu519 / HelloWorldScene.cpp
Created May 5, 2015 05:32
Cocos2d-x プールアロケータ
#include "HelloWorldScene.h"
USING_NS_CC;
cocos2d::allocator::AllocatorStrategyPool<HelloWorld> HelloWorld::allocator_pool{"HelloWorldPool"};
Scene* HelloWorld::createScene()
{
auto scene = Scene::create();
auto layer = HelloWorld::create();
@yasuharu519
yasuharu519 / Makefile
Created April 4, 2015 15:15
GLFWプログラムのMakefile
CXX = clang++
CFLAGS = -I/usr/local/include
LDFLAGS = -framework OpenGL -L/usr/local/lib -lglfw
a.out: sample.cpp
$(CXX) $(CFLAGS) sample.cpp $(LDFLAGS)
#include <GLFW/glfw3.h>
#include <stdlib.h>
#include <stdio.h>
static void error_callback(int error, const char* description)
{
fputs(description, stderr);
}
static void key_callback(GLFWwindow* window, int key, int scancode, int action,
@yasuharu519
yasuharu519 / CMakeLists.txt
Created January 13, 2015 17:39
CMakeLists file for dropbox/json11 https://github.com/dropbox/json11
cmake_minimum_required(VERSION 2.8)
add_definitions("-Wall -std=c++11")
add_library(json11 STATIC json11.cpp)
install(TARGETS json11 ARCHIVE DESTINATION lib LIBRARY DESTINATION lib)
install(FILES json11.hpp DESTINATION include)
@yasuharu519
yasuharu519 / algorithm_remove.cpp
Last active August 29, 2015 14:13
algorithmヘッダを使ったremoveの使用例
#include <iostream>
#include <vector>
static void print_vector(const std::vector<int>& v)
{
std::cout << "----- vector start -----" << std::endl;
for(const auto& i : v)
{
std::cout << i << " ";
}
@yasuharu519
yasuharu519 / algorithm_find.cpp
Last active August 29, 2015 14:13
algorithmヘッダを使ったfindの使用例
#include <iostream>
#include <vector>
int main()
{
std::vector<int> v{1, 2, 3, 4, 5, 6};
int target = 5;
auto it = std::find(v.begin(), v.end(), target);
bool flag = it != v.end();
@yasuharu519
yasuharu519 / crawl_instagram.cpp
Last active August 29, 2015 14:13
Instagramの猫画像クローラ crawl_instagram.cpp
#include <fstream>
#include <iostream>
#include <mutex>
#include <string>
#include <thread>
#include <restclient-cpp/restclient.h>
#include <json11.hpp>
#include <iostream>
#include <restclient-cpp/restclient.h>
static std::string test_url = "http://www.google.com";
int main()
{
auto res = RestClient::get(test_url);
std::cout << "# Code" << std::endl;