Skip to content

Instantly share code, notes, and snippets.

View manchan's full-sized avatar
🏖️
Working from home

Yuichi Matsuoka manchan

🏖️
Working from home
View GitHub Profile
@manchan
manchan / amz.php
Created October 20, 2014 09:21
AmazonProductAdvertisingApiSample.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>amazon <span class="goog_qs-tidbit goog_qs-tidbit-1">Product Advertising API practice</title>
</head>
<body>
<h1>amazon Product Advertising API sample</h1></span>
<form action="" method="get">
@manchan
manchan / MyPlayground.swift
Created October 20, 2014 09:23
MyPlayground1
// Playground - noun: a place where people can play
import UIKit
var str = "Hello, playground"
// コンソール上にHello Worldの表示
println("Hello, world!")
// 変数
@manchan
manchan / MyPlayground2.swift
Created October 20, 2014 10:03
MyPlayground2.swift
// Playground - noun: a place where people can play
import UIKit
var str = "Hello, playground"
// オブジェクトとクラス
// クラス宣言
class Shape {
@manchan
manchan / generate_document.sh
Created October 20, 2014 12:17
TableDefineScript
#!/bin/sh
IFS='
'
db_name=$1
if [ "$db_name" = "" ]; then
echo "you should specify a name of db."
exit
fi
@manchan
manchan / Reader.php
Created October 20, 2014 16:14
PHP File_Archiveの日本語文字化け問題対処法
// File_Archiveの日本語文字化け問題対処法
// ライブラリのソースを修正
// vi /usr/local/lib/php/File/Archive/Reader.php
function getStandardURL($path)
{
  if ($path == '.') {
   return '';
  }
@manchan
manchan / unzip-cp932.pl
Created October 20, 2014 16:19
Windowsから送られてきたzipファイルを解凍する(日本語ファイル名が含まれている場合)
#!/usr/bin/perl
use Archive::Zip;
use Encode;
use Encode::Guess qw/CP932/;
my $zip = Archive::Zip->new($ARGV[0]) or die;
#print $ARGV[1];
chdir $ARGV[1];
@manchan
manchan / angular-start.txt
Created October 21, 2014 06:20
Angularjs-start テスト環境構築
// Angular環境構築 node.jsが入っている状態で。
mkdir angularjs
cd angularjs/
// yeomanでwebページのひな型生成ツールインストール
npm install -g yo
// AngularJSのひな形生成
yo angular
// Serverタスク実行、アプリ起動
grunt serve
@manchan
manchan / github-oauth.php
Created October 22, 2014 07:33
GitHub APIのアクセストークンを取得
<?php
define('CLIENT_ID', '上記で取得したClient ID');
define('CLIENT_SECRET', '上記で取得したClient Secret');
if (empty($_GET['code'])) {
// Authrize URLの構築
$params = array(
'client_id' => CLIENT_ID,
'scope' => 'repo', // 必須ではない。下記説明参照。
@manchan
manchan / getPrefecture.swift
Last active August 29, 2015 14:08
getPrefecture and bind PickerView
//
// ViewController.swift
// getPrefecture
//
// Created by matz on 2014/10/24.
// Copyright (c) 2014年 matz. All rights reserved.
//
import UIKit
@manchan
manchan / jsonRead.m
Created October 26, 2014 09:33
JsonRead.swift and Objective-C
//
// ViewController.m
// localFileRead
//
// Created by matz on 2014/10/26.
// Copyright (c) 2014年 matz. All rights reserved.
//
#import "ViewController.h"