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
@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 / 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
*/
@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 'やはりそうでしたか。なるほどですね。';
}
@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