Skip to content

Instantly share code, notes, and snippets.

View horike37's full-sized avatar

Takahiro Horike horike37

  • Serverless Operations, Inc
  • Japan
View GitHub Profile
@santiagobasulto
santiagobasulto / gist:3056999
Created July 5, 2012 23:05
Mocking private methods in python
""" This is a simple gist to show how to mock
private methods. I've got lots of questions
regarding this topic. Most people seems confused.
Hope it helps.
"""
import unittest
import mock
@8bitodyssey
8bitodyssey / gist:4108830
Created November 19, 2012 03:44 — forked from ShinichiNishikawa/gist:4108737
最強のテンプレートタグ get_the_khoshino()
<?php
function get_the_khoshino($destination == null, $username == null) {
if ( $destination ) {
return 'というわけで、' . $destination . 'に向かっています';
} else {
if (!empty($username)) {
return 'いやいや'.$username.'さんほどでは。';
} else {
return 'やはりそうでしたか。なるほどですね。';
}
@hissy
hissy / nav-menu-exporter-importer.php
Last active August 13, 2023 17:06
[WordPress Plugin] Nav Menu Exporter and Importer / Export and Import nav menus. Requires WordPress Importer plugin.
<?php
/*
Plugin Name: Nav Menu Exporter and Importer
Description: Export and Import nav menus. Requires WordPress Importer plugin
Author: hissy, megumi themes
Version: 0.1
Text Domain: nav-menu-exporter-importer
License: GPL version 2 or later - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
*/
@kakky
kakky / yahoojp.py
Last active December 1, 2020 11:39
Example of Yahoo! JAPAN OpenID Connect (YConnect) backend using python-social-auth
# -*- coding: utf-8 -*-
"""
yohoojp.py - Yahoo! JAPAN OpenID Connect (YConnect) backends of python-social-auth.
https://github.com/omab/python-social-auth
http://developer.yahoo.co.jp/yconnect/
settings.py should include the following:
SOCIAL_AUTH_YAHOOJP_OIDC_KEY = '...'
SOCIAL_AUTH_YAHOOJP_OIDC_SECRET = '...'
SOCIAL_AUTH_YAHOOJP_OIDC_AUTH_EXTRA_ARGUMENTS = {'display': 'touch', 'prompt': 'login'}
@hissy
hissy / gist:6822610
Created October 4, 2013 08:14
[WordPress/ACF] example of import values to repeater field
<?php
$value = array(
array(
'text' => 'text',
'image' => 1
),
array(
'text' => 'text2',
'image' => 2
)
@DmZ
DmZ / pre-commit
Last active July 25, 2023 13:40
Git pre-commit hook to search for Amazon AWS API keys.
#!/bin/sh
if git rev-parse --verify HEAD >/dev/null 2>&1
then
against=HEAD
else
# Initial commit: diff against an empty tree object
against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
fi

インスタグラムAPIが仕様変更し、アプリケーション・サービスへの利用には申請と承認が必要に

2015年11月17日からインスタグラムの提供しているAPIの仕様が大幅に変更されました。

仕様変更する前までは、インスタグラムのアカウント所有者であれば誰でも、開発者登録をするだけでAPI機能の全てを使用することができましたが、今回の変更で、APIの正式利用にはインスタグラムにレビューの申請をして承認されることが必須となりました。
また、17日以前に作成したアプリケーション・サービスについても、2016年6月1日までに申請し承認されなければ、自動的にテスト(サンドボックス)モードに切り替わるようです。

インスタグラムAPI利用規約の日本語訳

英語でしか表記のなかった規約の一部を日本語に翻訳したので、まとめておきます。

@doyle
doyle / gist:92b0b34cd4804d237ed9661e20e33e5d
Created October 17, 2016 19:51
Use curl to upload a file to a S3 pre-signed url
curl -X PUT -T test_s3.txt -L "https://your-bucket.s3.amazonaws.com/url-stuff"
@keesiemeijer
keesiemeijer / setup-phpunit.sh
Last active December 8, 2023 11:02
Setup PHPUnit for use in the Local by Flywheel app
#!/usr/bin/env bash
# ===============================================================================
# Script to install PHPUnit in the Local by Flywheel Mac app
# These packages are installed
#
# PHPUnit, curl wget, rsync, git, subversion and composer.
#
# WordPress is installed in the `/tmp/wordpress` directory for use by PHPUnit.
# The WordPress test suite is installed in the `/tmp/wordpress-tests-lib` directory.
@HyperBrain
HyperBrain / lifecycle-cheat-sheet.md
Last active June 7, 2024 05:17
Serverless Lifecycle Cheat Sheet

Serverless plugin author's cheat sheet

This cheat sheet provides a detailed overview of the exposed lifecycle events and available commands (and entrypoints) of the Serverless framework, that can be hooked by plugins (internal and external ones). The document is structured by the commands invoked by the user.

Lifecycle events are shown as the globally available outer events (all providers) and sub lifecycle events that are provider specific in the called order. Currently only the AWS provider is shown. If you have information about the other provider,