Skip to content

Instantly share code, notes, and snippets.

@p-baleine
p-baleine / Vagrantfile
Created July 28, 2015 00:27
Elixirで遊ぶためのVagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Provisioning script
$script = <<SCRIPT
sudo yum -y install gcc glibc-devel make ncurses-devel openssl-devel autoconf unzip
curl -O http://www.erlang.org/download/otp_src_18.0.tar.gz
tar zxvf otp_src_18.0.tar.gz
cd otp_src_18.0
@p-baleine
p-baleine / OSSにもっと関わる.md
Last active August 29, 2015 14:25
個人的な目標設定、わざと自分への戒めのためにpublic設定

OSSにもっと関わる

なんで

もともと、プログラム勉強しはじめた7、8年前からOSSに興味はあった、当時だとRubyのコミッターにあこがれていた。具体的な動機としては、以下があると思う:

  • OSSの世界で活躍している人に憧れが有る
  • OSSの世界で有名になりたい
  • そもそもオープンであるべし、というマインドが自分に合っている
  • OSSの世界だと、会話の成り立つ人と繋がれる
@p-baleine
p-baleine / vertx-cluster.md
Last active June 11, 2016 17:19
vertx-cluster
こんな感じでVM二つ立ち上げて
```rb
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.box = "chef/centos-6.5"
config.vm.synced_folder ".", "/home/vagrant/cluster"
@p-baleine
p-baleine / README.md
Last active August 29, 2015 14:19
Vert.x事始め
@p-baleine
p-baleine / MainCamera.cs
Last active August 29, 2015 14:15
Unityでsocket.io
using UnityEngine;
using System.Collections;
using SocketIO;
public class MainCamera : MonoBehaviour
{
#region Public Properties
static public SocketIOComponent socket;
@p-baleine
p-baleine / index.js
Created January 29, 2014 01:45
bookshelf-belongsTo-through
var config = require('./db/config').database;
var Bookshelf = require('bookshelf').initialize(config);
var Promise = require('bluebird');
var Genre = Bookshelf.Model.extend({
tableName: 'genres'
});
var Post = Bookshelf.Model.extend({
tableName: 'posts'
// googleみたいなページネーション用のrangeを返す
// maxが例えば17の場合
// current => range
// 1 => 1..10
// 2 => 1..10
// ....
// 6 => 1..10
// 7 => 2..11
// ....
// 14 => 8..17
#!/usr/bin/env node
var argv = require('optimist').argv;
process.stdout.write(argv._.join('\n') + '\n');
@p-baleine
p-baleine / README.md
Created November 29, 2013 08:59
Bookshelf polymorphic association example.

Migrate

$ ./node_modules/.bin/knex:migrate:latest -c db/config.js
/*
* Process migration with knex.
*/
/*
* Migration
*/
function Migration() {
this.trapInterfaceConstraint();