Skip to content

Instantly share code, notes, and snippets.

View satoryu's full-sized avatar
🤘
Put your 🦊 up!

Tatsuya Sato satoryu

🤘
Put your 🦊 up!
View GitHub Profile
@satoryu
satoryu / Gemfile
Last active August 1, 2017 12:03
Tiny sample application for Application Insights
# frozen_string_literal: true
source "https://rubygems.org"
gem 'sinatra'
gem 'application_insights', github: "Microsoft/ApplicationInsights-Ruby"
@satoryu
satoryu / CSVHelper.cs
Created June 13, 2017 01:54 — forked from TsuyoshiUshio/CSVHelper.cs
Visual Studio Hack
using CsvHelper;
using MongoDB.Bson;
using MongoDB.Driver;
using System;
using System.IO;
using System.Text;
using System.Threading;
namespace CSVTest
{
@satoryu
satoryu / README.md
Last active July 18, 2018 22:14
This template is for deploying a Web App for running PHP application whose dependencies are managed with Composer.

ARM Template to deploy new Web App for PHP application with Composer

The Azure Resource Manager template is for deploying

  • New Web App instance of PHP 7.0 under Free plan
  • Then install the site extension Composer to the Web App

Usage

Prerequisites

irb(main):001:0> puts 'おはようございます'.dajarize
おはようございマスキングテープ
おはようございマスク
おはようございマスタング
おはようございマスターピース
おはようございマスカットナイト
おはようございマスカラ
おはようございマスカレード
おはようござい増田貴久
おはようござい増田有華
@satoryu
satoryu / check_csv_format.rb
Created February 8, 2016 07:22
Toy script to check the format of a given CSV file.
require 'csv'
data_file = ARGV.shift
File.foreach(data_file).each_with_index do |row, n|
begin
CSV.parse_line(row)
rescue CSV::MalformedCSVError => e
STDERR.puts "#{n}: #{e.to_s}"
next
@satoryu
satoryu / gist:495913e59bb249b060cc
Created February 6, 2016 09:28
Uninstalled mongodb manually and reinstalled it then mongodb cannot be launched with this error.
2016-02-06T18:10:44.893+0900 I CONTROL [main] ***** SERVER RESTARTED *****
2016-02-06T18:10:44.910+0900 I CONTROL [initandlisten] MongoDB starting : pid=46957 port=27017 dbpath=/usr/local/var/mongodb 64-bit host=P23722.local
2016-02-06T18:10:44.910+0900 I CONTROL [initandlisten] db version v3.2.1
2016-02-06T18:10:44.910+0900 I CONTROL [initandlisten] git version: a14d55980c2cdc565d4704a7e3ad37e4e535c1b2
2016-02-06T18:10:44.910+0900 I CONTROL [initandlisten] allocator: system
2016-02-06T18:10:44.910+0900 I CONTROL [initandlisten] modules: none
2016-02-06T18:10:44.910+0900 I CONTROL [initandlisten] build environment:
2016-02-06T18:10:44.910+0900 I CONTROL [initandlisten] distarch: x86_64
2016-02-06T18:10:44.910+0900 I CONTROL [initandlisten] target_arch: x86_64
2016-02-06T18:10:44.910+0900 I CONTROL [initandlisten] options: { config: "/usr/local/etc/mongod.conf", net: { bindIp: "127.0.0.1" }, storage: { dbPath: "/usr/local/var/mongodb" }, systemLog: { destination: "file", logAppend: true, path
package main
import (
"fmt"
)
type Fetcher interface {
// Fetch returns the body of URL and
// a slice of URLs found on that page.
Fetch(url string) (body string, urls []string, err error)
@satoryu
satoryu / func.erl
Last active August 29, 2015 14:05
the function comb returns the list of all combinations of a given list.
-module(func).
-export([comb/2, multi/2]).
multi(X, []) -> [X];
multi(X, [H|T]) -> multi1(X, [H|T], []).
multi1(_, [], Result) -> Result;
multi1(X, [H|Tail], []) -> multi1(X, Tail, [X|H]);
multi1(X, [H|Tail], Result) ->
multi1(X, Tail, [[X|H] | Result]).
module SSHKit
module Formatter
class Owata < SSHKit::Formatter::Abstract
def write(obj)
return unless obj.is_a?(SSHKit::Command)
return unless obj.finished?
original_output << "#{obj.command} \(^o^)/ オワタ\n"
end
@satoryu
satoryu / javascript_resources.md
Created November 15, 2013 05:19 — forked from jookyboi/javascript_resources.md
Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.

Libraries

  • jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
  • Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
  • AngularJS - Conventions based MVC framework for HTML5 apps.
  • Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
  • lawnchair - Key/value store adapter for indexdb, localStorage