Skip to content

Instantly share code, notes, and snippets.

View ma2saka's full-sized avatar

ma2saka ma2saka

  • Hatena
View GitHub Profile
@ma2saka
ma2saka / Dockerfile
Created September 27, 2018 12:41
ec-cube 2.13.5を試すコンテナの作成と起動
FROM php:5-apache
RUN apt update
RUN apt-get install -y apt-file vim mysql-client && apt-file update && apt-get install -y software-properties-common && \
add-apt-repository ppa:ondrej/php && \
docker-php-ext-install pdo_mysql mbstring mysql
RUN curl -o eccube-2_13.tar.gz https://codeload.github.com/EC-CUBE/eccube-2_13/tar.gz/eccube-2.13.5 && tar xvzf eccube-2_13.tar.gz
RUN echo 'date.timezone = Asia/Tokyo' >> /usr/local/etc/php/conf.d/99_myconf.ini
RUN cp -r eccube-2_13-eccube-2.13.5/* ./ && rm -rf eccube-2_13-eccube-2.13.5/
RUN sh setup.sh
RUN sed -i -e 's|DocumentRoot /var/www/html|DocumentRoot /var/www/html/html|' /etc/apache2/sites-available/000-default.conf
@ma2saka
ma2saka / counter.js
Created August 29, 2018 02:33
react-redux-simple
import React from "react";
import { render } from "react-dom";
import { connect } from "react-redux";
// 単純に props の value を表示するプレゼンテーションコンポーネントと、
// Reduxの管理するストアからステートを受け取り、コンポーネントの props にマッピングするコンテナコンポーネント
const ValueComponent = props => <>value = {props.value}</>;
export const Value = connect(state => ({
value: state.value
}))(ValueComponent);
@ma2saka
ma2saka / LifeGame.scala
Created February 12, 2017 04:48
ProcessingでLifeGameをScala実装
import processing.core.PApplet
import processing.core.PConstants._
class App extends PApplet {
private[this] val CELL_SIZE = 10
private[this] val W = 102
private[this] val H = 76
private[this] val arr = new Array[Boolean](W * H)
private[this] val tmp_arr = new Array[Boolean](W * H)
@ma2saka
ma2saka / App.scala
Created February 10, 2017 16:20
https://www.openprocessing.org/sketch/149337 を Scala に移植してみたもの。
import processing.core.PConstants._
import processing.core.{PApplet, PFont, PGraphics, PVector}
import scala.collection.mutable.ArrayBuffer
// Original is : https://www.openprocessing.org/sketch/149337 by Jerome Herr
//
class App extends PApplet {
lazy val letterGraphic: PGraphics = {
createGraphics(width, height)
@ma2saka
ma2saka / Flock.scala
Created February 10, 2017 04:28
Scala x Processing
import processing.core.PConstants._
import processing.core.{PApplet, PVector}
import scala.collection.mutable.ListBuffer
class Boid(x: Float,y: Float, private[this] val pApplet: PApplet) {
private[this] val R = 2.0f
private[this] val MAX_FORCE = 0.03f
private[this] val MAX_SPEED = 2.0f
private[this] val NEIGHBORHOOD_DIST = 50f