Skip to content

Instantly share code, notes, and snippets.

View tsmsogn's full-sized avatar
:octocat:
Set your status

tsmsogn tsmsogn

:octocat:
Set your status
View GitHub Profile
@tsmsogn
tsmsogn / Dockerfile
Last active October 18, 2016 08:40
Dockerfile: atlassian:default-image + Qt4
FROM atlassian/default-image:latest
RUN apt-get update -y
RUN apt-get install -y libqt4-dev libqtwebkit-dev
@tsmsogn
tsmsogn / Dockerfile
Last active September 29, 2016 23:49
Dockerfile for CentOS6 + Nginx
FROM centos:6
RUN yum update -y
RUN yum install epel-release -y
RUN yum install nginx -y
#=> Can not login via bash...
ENTRYPOINT /usr/sbin/nginx -g 'daemon off;' -c /etc/nginx/nginx.conf
EXPOSE 22 80 443
@tsmsogn
tsmsogn / ViewCacheCleanerBehavior.php
Last active September 15, 2016 00:14
[cakephp]Deletes all view cache when there has been an INSERT, UPDATE, or DELETE query made
<?php
/**
* Class ViewCacheCleanerBehavior
*/
class ViewCacheCleanerBehavior extends ModelBehavior {
/**
* @var array
*/
@tsmsogn
tsmsogn / deploy.php
Last active August 1, 2017 01:58
[git]Shell script for deploing your git project automatically and safely by webhooks
<?php
shell_exec('/path_to_deploy.sh/deploy.sh path_to_repo');
p = 4
for i in 0...(1 << p)
stack = Array.new(p, 0)
for j in 0...p
stack[j] = 1 if i >> j & 1 != 0
end
puts stack.join
end
@tsmsogn
tsmsogn / vagrant_coreos_docker.md
Created February 19, 2016 10:07 — forked from yasushiyy/vagrant_coreos_docker.md
Vagrant + CoreOS + Dockerを利用した開発環境セットアップ

Vagrant + CoreOS + Dockerを利用した開発環境セットアップ

MacOSX + Vagrant + CoreOS + Docker + Ubuntuの環境。

2014年6月11日時点での情報。

  • Version: CoreOS 343.0.0
  • Kernel: 3.14.5
  • Docker: 1.0
@tsmsogn
tsmsogn / Cartesian.php
Created February 17, 2016 00:47 — forked from jwage/Cartesian.php
PHP Cartesian Function
<?php
$attributeValues = array(
'color' => array('Red', 'White', 'Blue'),
'size' => array(1, 2, 3, 4),
'fabric' => array('Cloth', 'Silk')
);
class Cartesian
{
def get_max_length(grid, n)
max_length = 0
for y in 0...n
length = 0
for x in 0...n
if grid[y][x] == 1
length += 1
max_length = length if length > max_length
else
def get_max_length(grid, n)
max_length = 0
for y in 0...n
length = 0
for x in 0...n
if grid[y][x] == 1
length += 1
max_length = length if length > max_length
else