MacOSX + Vagrant + CoreOS + Docker + Ubuntuの環境。
2014年6月11日時点での情報。
- Version: CoreOS 343.0.0
- Kernel: 3.14.5
- Docker: 1.0
/* | |
How to use: | |
1)Create new file. | |
2) | |
*/ | |
function kana2upper(string) { |
web: | |
image: occitech/cakephp:5-apache | |
ports: | |
- 80 | |
links: | |
- db | |
volumes: | |
- .:/var/www/html | |
environment: |
machine github.com | |
login technoweenie | |
password SECRET | |
machine api.github.com | |
login technoweenie | |
password SECRET |
<?php | |
$attributeValues = array( | |
'color' => array('Red', 'White', 'Blue'), | |
'size' => array(1, 2, 3, 4), | |
'fabric' => array('Cloth', 'Silk') | |
); | |
class Cartesian | |
{ |
<?php | |
//For PHP 5.3.x or later | |
public function emailExtended($data, $deep = false) { | |
$pattern = '/.+@(docomo|ezweb)\.ne\.jp$/i'; | |
$check = preg_replace_callback($pattern, function($matches) { | |
$patterns = array('/\.{2,}/', '/\.@/'); | |
$replacements = array('.', '@'); | |
return preg_replace($patterns, $replacements, $matches[0]); | |
}, array_shift($data)); | |
return Validation::email($check, $deep); |
#なんだかんだ
##えーと1 どういうこういう そういうどういう
##えーと2 どういうこういう そういうどういう
#!/usr/local/bin/ruby | |
# -*- coding: utf-8 -*- | |
require 'cgi' | |
filename, = ARGV # path of file `ctype-uca.c' | |
ctype_uca = File.read(filename) | |
ctype_uca =~ /^uchar uca_length\[256\]={\n(.*?)};$/m or raise 'uca_length not found' | |
uca_length = $1.gsub(/\s/,'').split(/,/).map(&:to_i) |
<?php | |
// requires php5 | |
define('UPLOAD_DIR', 'images/'); | |
$img = $_POST['img']; | |
$img = str_replace('data:image/png;base64,', '', $img); | |
$img = str_replace(' ', '+', $img); | |
$data = base64_decode($img); | |
$file = UPLOAD_DIR . uniqid() . '.png'; | |
$success = file_put_contents($file, $data); | |
print $success ? $file : 'Unable to save the file.'; |
/* Stack-based Douglas Peucker line simplification routine | |
returned is a reduced GLatLng array | |
After code by Dr. Gary J. Robinson, | |
Environmental Systems Science Centre, | |
University of Reading, Reading, UK | |
*/ | |
function GDouglasPeucker (source, kink) | |
/* source[] Input coordinates in GLatLngs */ | |
/* kink in metres, kinks above this depth kept */ |