Skip to content

Instantly share code, notes, and snippets.

View ryhmrt's full-sized avatar

Ryohei Morita ryhmrt

  • Tokyo
View GitHub Profile
FROM ruby:2.7.1-alpine3.11 AS base
ENV LANG="C.UTF-8"
ENV RUNTIME_LIBS="mariadb-connector-c tzdata"
ENV BUILD_LIBS="build-base mariadb-connector-c-dev"
ENV WORKSPACE="/opt/app/src"
RUN mkdir -p $WORKSPACE && \
apk add --no-cache $RUNTIME_LIBS
@ryhmrt
ryhmrt / builtin-server.php
Created November 19, 2012 09:57 — forked from tanakahisateru/builtin-server.php
CakePHP2 by PHP5.4 builtin server
<?php
/**
* Place this file in CakePHP's root dir and do:
* $ php -S localhost:8080 builtin-server.php
* with PHP5.4
*/
if (strpos($_SERVER['REQUEST_URI'], '?')) {
list($path, $param) = preg_split('/\?/', $_SERVER['REQUEST_URI'], 2);
} else {
$path = $_SERVER['REQUEST_URI'];
@ryhmrt
ryhmrt / User.rb
Created April 19, 2012 03:05 — forked from kenchan/User.rb
indent?
class User < ActiveRecord::Base
validates :email,
presence: true,
format: { with: VALID_EMAIL_REGEX },
uniqueness: { case_sensitive: false }
end
@ryhmrt
ryhmrt / gist:2224500
Created March 28, 2012 07:34
say deeeeeeeeeeeattttth
for n in {1..10}; do; say -r 1 -v Ralph deeeeeeeeeeeattttth &; done
@ryhmrt
ryhmrt / gist:1513708
Created December 23, 2011 09:25
Solves FF13-2 Time Labyrinth Clock Quiz
use strict;
my @t = map { {'v' => $_} } split //, "114152264215";
for my $i (0..$#t) {
$t[$i]{'i'} = $i;
my $ni = $i + $t[$i]{'v'};
$ni -= @t if ($ni >= @t);
my $pi = $i - $t[$i]{'v'};
$ni += @t if ($ni < 0);
$t[$i]{'n'} = $t[$ni];
@ryhmrt
ryhmrt / gisthere.html
Created July 5, 2011 08:37
include gist code via anchor tag.
<html>
<head>
<link rel="stylesheet" href="https://gist.github.com/stylesheets/gist/embed.css"/>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script type="text/javascript" src="https://raw.github.com/gist/1064493/gisthere.js"></script>
</head>
<body>
↓↓↓ gist here! ↓↓↓
<hr/>
<a href="https://raw.github.com/gist/1064493/gisthere.js">gisthere.js</a>