Skip to content

Instantly share code, notes, and snippets.

@sh19910711
sh19910711 / GSoC2016.md
Created Aug 22, 2016
Ruby::GSoC2016::WebConsole
View GSoC2016.md
@sh19910711
sh19910711 / !git-contest.md
Last active Jan 3, 2016
git-contest specification drafts
View !git-contest.md
View index.coffee
path = require 'path'
yeoman = require 'yeoman-generator'
module.exports = class TestGenerator extends yeoman.generators.Base
constructor: (args, options, config) ->
yeoman.generators.Base.apply this, arguments
@on 'end', ->
@installDependencies skipInstall: options['skip-install']
@pkg = JSON.parse @readFileAsString path.join __dirname, '../package.json'
@sh19910711
sh19910711 / gist:5241225
Created Mar 25, 2013
メソッドのチェック
View gist:5241225
#include <iostream>
using namespace std;
struct TestA {
int needed_method() {
cout << "test" << endl;
return 0;
}
};
@sh19910711
sh19910711 / box2d-js-loadlist.txt
Created Mar 10, 2013
JavaScript用のbox2dをminifyするときに使う
View box2d-js-loadlist.txt
./common/b2Settings.js
./common/math/b2Vec2.js
./common/math/b2Mat22.js
./common/math/b2Math.js
./collision/b2AABB.js
./collision/b2Bound.js
./collision/b2BoundValues.js
./collision/b2Pair.js
./collision/b2PairCallback.js
./collision/b2BufferedPair.js
@sh19910711
sh19910711 / thread.cpp
Created Mar 10, 2013
Boost.AsioでThreadを作る例
View thread.cpp
// compile: g++ -lboost_system -lboost_thread thread.cpp
#include <iostream>
#include <boost/thread.hpp>
#include <boost/bind.hpp>
void test1() {
for ( int i = 0; i < 10; ++ i )
std::cout << "test 1" << std::endl;
}
@sh19910711
sh19910711 / client.cpp
Created Mar 10, 2013
UNIX-domain socketsを使ってClient/Serverする例
View client.cpp
// compile: g++ -lboost_system client.cpp
#include <iostream>
#include <boost/asio.hpp>
const std::string SOCKET_NAME = "/tmp/socket";
int main(){
boost::asio::io_service io_service;
boost::asio::local::stream_protocol::socket socket(io_service);
boost::asio::local::stream_protocol::endpoint ep(SOCKET_NAME);