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 / kana2upper.js.gs
Created June 25, 2018 04:32 — forked from sa-nitawaki/kana2upper.js.gs
google spreadsheet で半角カナを全角カナにする関数 kana2upper() を作成
/*
How to use:
1)Create new file.
2)
*/
function kana2upper(string) {
web:
image: occitech/cakephp:5-apache
ports:
- 80
links:
- db
- mail
volumes:
- .:/var/www/html
environment:
@tsmsogn
tsmsogn / gist:e1e1c406e2f50ddf7876678ab38540fe
Created December 9, 2016 02:38 — forked from technoweenie/gist:1072829
.netrc file so you can push/pull to https git repos without entering your creds all the time
machine github.com
login technoweenie
password SECRET
machine api.github.com
login technoweenie
password SECRET
@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
{
<?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)
@tsmsogn
tsmsogn / canvas-upload.php
Created December 5, 2012 13:01 — forked from xjamundx/canvas-upload.php
[php]Canvas base64_decode()
<?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 */