Skip to content

Instantly share code, notes, and snippets.

View matsubo's full-sized avatar

Yuki Matsukura matsubo

View GitHub Profile
@matsubo
matsubo / gist:1964936
Created March 3, 2012 08:07 — forked from tanakahisateru/gist:1344162
PHP5.4 configure with MacPorts besides existing PHP
./configure \
--prefix=/opt/local/php/5.4 \
--bindir=/opt/local/bin \
--with-config-file-path=/opt/local/php/5.4/etc \
--with-config-file-scan-dir=/opt/local/php/5.4/var/db \
--mandir=/opt/local/php/5.4/share/man \
--infodir=/opt/local/php/5.4/share/info \
--program-suffix=-5.4 \
--with-apxs2=/opt/local/apache2/bin/apxs \
--enable-pdo \
@matsubo
matsubo / gist:2543898
Created April 29, 2012 08:10
Import all the text file into evernote.
set listOfNames to {}
set theFolder to choose folder "Select the source folder"
tell application "Finder"
set filelist to every file of the folder theFolder
repeat with currentFile in filelist
set currentFileName to (the name of currentFile)
set nom to currentFileName
if text -4 of nom is "." then
set currentFileName to (text 1 thru -5 of nom)
@matsubo
matsubo / gist:2544706
Created April 29, 2012 08:18
IX2015 setting dump
! NEC Portable Internetwork Core Operating System Software
! IX Series IX2010 (magellan-sec) Software, Version 8.3.44, RELEASE SOFTWARE
! Compiled Oct 20-Tue-2009 13:28:55 JST #1
! Current time Jan 05-Tue-2010 14:53:33 JST
!
!
timezone +09 00
!
!
!
@matsubo
matsubo / gist:2773009
Created May 23, 2012 02:57
Disabling local timemachine cache
sudo tmutil disablelocal
@matsubo
matsubo / gist:3128217
Created July 17, 2012 09:05
Host alive checker
<?php
/**
* Send mail with response if the target host is up
*
* @author Yuki Matsukura
* @date 2011-09-24
*/
/** @var string target URL */
$url = 'https://buy.itunes.apple.com/verifyReceipt';
(function() {
var E;
function Aa(a, b) {
switch (b) {
case 0:
return "" + a;
case 1:
return 1 * a;
case 2:
<!-- Google Tag Manager -->
<noscript><iframe src="//www.googletagmanager.com/ns.html?id=GTM-M6PVTL"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-M6PVTL');</script>
<!-- End Google Tag Manager -->
@matsubo
matsubo / README.md
Last active November 29, 2015 15:55
bundle install on Ruby 2.0.0. after upgrading to El Capitan (Mac OS X 10.11.1)

Ruby 2.0.0. trouble shooting on El Capitan

Assumptions

  • User name is matsu
  • Production ruby version is 2.0.0-p247
    • it's hard to test to update minor version.
    • Patch version can be updated easily.
class PostcodesController < ApplicationController
before_action :set_postcode, only: [:show]
swagger_controller :postcodes, 'Postcodes'
swagger_api :index do
summary 'Returns postcodes'
notes 'List postcodes'
param :query, :page, :integer, :optional, "Page number"
response :ok, "Success", :Postcode
Swagger::Docs::Config.register_apis({
"1.0" => {
# the extension used for the API
:api_extension_type => :json,
# the output location where your .json files are written to
:api_file_path => "public/apidocs/",
# the URL base path to your API
:base_path => "http://postcode.teraren.com",
# if you want to delete all .json files at each generation
:clean_directory => true,