Skip to content

Instantly share code, notes, and snippets.

(function () {
alert('this is a sample snipet. My First Github Gist Using.')
})();
@yoheiMune
yoheiMune / gunzip.js
Last active August 29, 2015 14:07
Gzip and Gunzip with Node
var fs = require('fs');
var zlib = require('zlib');
// ファイルを読み込みます
var gzipContent = fs.readFileSync('./hello.txt.gz');
// 解凍します
zlib.gunzip(gzipContent, function (err, binary) {
// ファイルに出力します
@yoheiMune
yoheiMune / シナリオ
Last active August 29, 2015 14:08
(補足資料)デザイナー・エンジニア必見!魅力的なプレゼンを準備する3つのステップ
◆導入:誰向けか、何を提供するのか、なぜ話すのか(2分)
・自己紹介
・社内外の勉強会で登壇したいと思っているが、プレゼン制作が難しいと考えている人
・プレゼンテーション制作において1つの道を示す
・プレゼンテーションスキルは情報を伝えるだけではなく、人の心を動かす力もある
◆主題:プレゼンテーションの準備にはステップがある(1分)
・パワポなどプレゼン制作ツールを最初から開いて悩むのはダメ。
・プレゼン作りには順序があり、それに従えば誰でも簡単に魅了的なプレゼンが作れる。
・その順序は大きく分けて3つ。「話の構成作り」「資料作り」「極める」
// 変数の定義(型を推定する)
var str = "Hello, playground"
var intValue = 1;
// 変数の定義(型を明示する)
var str2:String = "Good Night";
// 変数の定義
// 初期値も代入せず、型も定義しない場合には、エラーとなる
//var type;
@yoheiMune
yoheiMune / user.php
Created August 23, 2017 15:09
JSONを返却するサンプルです
<?php
// レスポンスヘッダーをJSONに指定する
header('Content-Type: application/json');
// 例えば、以下のデータを返したい場合に
$user = array(
'id' => 1,
'name' => 'Yohei'
);
@yoheiMune
yoheiMune / gs.py
Created February 16, 2017 05:58
G's ACADEMY TOKYO のメンター一覧からメンター画像を取得するサンプル.
"""
G's ACADEMY TOKYO からメンター画像を取得するサンプル.
"""
import os
from urllib.request import urlopen
from pprint import pprint
from bs4 import BeautifulSoup
# メンター一覧ページのHTMLを取得します.
with urlopen("http://gsacademy.tokyo/mentor/") as res:
@yoheiMune
yoheiMune / go_di_sample.go
Last active September 11, 2017 08:29
Goでテスト可能なサービス層とモデル層を考える
package main
import (
"fmt"
)
type UserModel interface {
Find() (User)
}
@yoheiMune
yoheiMune / geocoding.py
Created August 24, 2018 08:42
google geo location api and place api.
"""
Google Geocoding API を用いて、位置情報などを扱う.
"""
import os
import json
import time
import re
import csv
from pprint import pprint
from collections import OrderedDict
var paymentRequest = stripe.paymentRequest({
country: 'JP',
currency: 'jpy',
total: {
label,
amount: price,
},
requestPayerName : !!(item.item_type === QR_ITEM_TYPE_URL_LINK && item.pay_name_required),
requestPayerEmail : !!(item.item_type === QR_ITEM_TYPE_URL_LINK && item.pay_email_required),
requestPayerPhone : !!(item.item_type === QR_ITEM_TYPE_URL_LINK && item.pay_tel_required),
@yoheiMune
yoheiMune / file.swift
Created January 30, 2019 03:39
Yahoo!ローカルサーチAPIを利用してマップにアノテーションを立てる
// 検索される時に呼び出される.
func searchBarSearchButtonClicked(_ searchBar: UISearchBar) {
// キーボードを閉じます.
searchBar.resignFirstResponder()
// 検索ワードがなければ終了.
guard let searchTerm = searchBar.text else {
return
}