Skip to content

Instantly share code, notes, and snippets.

@satomacoto
satomacoto / README.md
Last active January 1, 2016 04:59
Vagrant and Chef
# cf. https://gist.github.com/crmccreary/5610068
import base64
from Crypto.Cipher import AES
from Crypto import Random
BS = 16
pad = lambda s: s + (BS - len(s) % BS) * chr(BS - len(s) % BS)
unpad = lambda s: s[0:-ord(s[-1])]
@satomacoto
satomacoto / app.py
Created December 1, 2013 13:46
msgpack, unity, c#, flask
# -*- coding: utf-8 -*-
import msgpack
from flask import Flask
app = Flask(__name__)
@app.route('/l')
def l():
"""
>>> import msgpack
using UnityEngine;
using System.Collections;
using System;
using System.IO;
using System.Text;
using System.Security.Cryptography;
public class Encrypt : ScriptableObject
{
public static byte[] EncryptBytes(byte[] message, byte[] rgbKey, byte[] rgbIV)
@satomacoto
satomacoto / readme.md
Created December 1, 2013 07:42
How to create hex mesh with Blender

Blender

  • Top view (7).
  • Delete (X) the cube.
  • Add (Shift+A) Mesh > Circle.
  • Vertices 6, Rotation 90°.
  • Set surface on Mesh tool (Tab > f) and back to Object tool (Tab).
  • Delete camera and lamp.
  • Apply (Ctrl+A) rotation.
  • Export as fbx.
@satomacoto
satomacoto / README
Created October 12, 2013 14:44
Flask + MessagePack
https://devcenter.heroku.com/articles/getting-started-with-python
http://flask.pocoo.org/
http://docs.python-requests.org/en/latest/
https://github.com/msgpack/msgpack-python
git config --global alias.ci "commit -a"
git config --global alias.co checkout
git config --global alias.st "status"
git config --global alias.stat "status"
git config --global alias.br branch
git config --global alias.wdiff "diff --color-words"
git config --global core.editor vim
git config --global merge.summary true
@satomacoto
satomacoto / README.md
Last active December 17, 2015 05:48
Hello backbone.js / script.coffee
@satomacoto
satomacoto / cca.py
Created April 7, 2013 06:34
正準相関分析(Canonical correlation analysis; cca)
#!/usr/bin/env python
# -*- coding:utf-8 -*-
'''
正準相関分析
cca.py
'''
import numpy as np
import scipy as sp
from scipy import linalg as LA