Skip to content

Instantly share code, notes, and snippets.

View TakashiSasaki's full-sized avatar

Takashi SASAKI TakashiSasaki

View GitHub Profile
@TakashiSasaki
TakashiSasaki / pip.log
Created March 6, 2014 23:45
PyCharmでGitPythonの最新版3.2 RC1をpipからインストールしようとすると失敗するのは、連動してインストールされるgitdb 0.5.4がPython 3に対応していないからか。未だにprintがステートメント扱いだし。
------------------------------------------------------------
C:\Program Files\JetBrains\PyCharm 3.1.1\helpers\packaging_tool.py run on 03/07/14 08:33:18
DEPRECATION: --no-install, --no-download, --build, and --no-clean are deprecated. See https://github.com/pypa/pip/issues/906.
Downloading/unpacking GitPython==0.3.2.RC1
Getting page https://pypi.python.org/simple/GitPython/
URLs to search for versions for GitPython==0.3.2.RC1:
* https://pypi.python.org/simple/GitPython/0.3.2.RC1
* https://pypi.python.org/simple/GitPython/
Getting page https://pypi.python.org/simple/GitPython/0.3.2.RC1
Could not fetch URL https://pypi.python.org/simple/GitPython/0.3.2.RC1: 404 Client Error: Not Found
@TakashiSasaki
TakashiSasaki / sshd_config
Last active August 29, 2015 13:57
OpenSSHでLANからだけパスワード認証を許可する
# sshd_config の末尾の書いておく。
# PermitRootLoginをyesにするかは微妙。
# Matchさせるアドレスは自分のLANの範囲にする。
Match Address 192.168.0.*
PasswordAuthentication yes
PermitRootLogin yes
@TakashiSasaki
TakashiSasaki / JavaScriptでどうやってクラスっぽいものの継承っぽいもことをやるの?.md
Last active August 29, 2015 14:00
JavaScriptでどうやってクラスっぽいものの継承っぽいもことをやるの?

C++/Java/Pythonでクラスは使ってるしPythonではメタクラスも使うけど、JavaScriptのプロトタイプベースの継承ってのがよく分からん。prototypeプロパティ、prototype.constructorプロパティ、__proto__プロパティ、Object.createメソッド、new演算子なんかの挙動がこんがらがって。アレコレ実験して確かめたつもりになっても、あれ?これってプロパティが設定されているわけじゃなくてプロトタイプチェーンたどって呼び出されてるだけだった、なんてことが多くて。アホやな俺。

#1 JavaScriptにおける継承 とりあえず以下のようにやる。

        var F = function(x){
            this.x = x;
        };
        
        F.prototype.setX = function(x){
@TakashiSasaki
TakashiSasaki / assertion.xml
Last active August 29, 2015 14:00
Shibbolethで返しているアサーションの例
<?xml version="1.0" encoding="UTF-8"?>
<saml2:Assertion xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion" ID="略" IssueInstant="2014-04-30T05:02: 42.901Z" Version="2.0">
<saml2:Issuer Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity">https://idp.lms.ehime-u.ac.jp/idp/shibboleth</saml2:Issuer>
<saml2:Subject>
<saml2:NameID Format="urn:oasis:names:tc:SAML:2.0:nameid-format:transient" NameQualifier="https://idp.lms.ehime-u.ac.jp/idp/shibboleth" SPNameQualifier="https://moo.chi.tokushima-u.ac.jp/shibboleth-sp">略</saml2:NameID>
<saml2:SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:bearer">
<saml2:SubjectConfirmationData Address="アクセス元PCのIPアドレス" InResponseTo="略" NotOnOrAfter="2014-04-30T05:07:42.901Z" Recipient="https://moo.chi.tokushima-u.ac.jp/Shibboleth.sso/SAML2/POST" />
</saml2:SubjectConfirmation>
</saml2:Subject>
<saml2:Conditions NotBefore="2014-04-30T05:02:42.901Z" NotOnOrAfter="2014-04-30T05:07:42.901Z">
<?xml version="1.0" encoding="UTF-8"?>
<saml2:Assertion xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion" ID="_c5a0536fbcfe99304cf36b09980cba2c" IssueInstant="2014-05-01T06:18:46.289Z" Version="2.0">
<saml2:Issuer Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity">https://idp.lms.ehime-u.ac.jp/idp/shibboleth</saml2:Issuer>
<saml2:Subject>
<saml2:NameID Format="urn:oasis:names:tc:SAML:2.0:nameid-format:transient" NameQualifier="https://idp.lms.ehime-u.ac.jp/idp/shibboleth" SPNameQualifier="https://moo.chi.tokushima-u.ac.jp/shibboleth-sp">_6cea0e3fcf929c299bb09dacefa7edbb</saml2:NameID>
<saml2:SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:bearer">
<saml2:SubjectConfirmationData Address="133.71.3.2" InResponseTo="_78531901ebd50b9b8c8bdfb9ae2fdc59" NotOnOrAfter="2014-05-01T06:23:46.289Z" Recipient="https://moo.chi.tokushima-u.ac.jp/Shibboleth.sso/SAML2/POST" />
</saml2:SubjectConfirmation>
</saml2:Subject>
<saml2:Conditions NotBefore="2014-05-01T06:18:4
@TakashiSasaki
TakashiSasaki / .gitconfig
Created June 6, 2012 15:01
Git global settings in .gitconfig file on Windows.
[gui]
[user]
name = Takashi SASAKI
email = takashi316@gmail.com
[core]
whitespace = trailing-space,space-before-tab,indent-with-non-tab
autocrlf = true
repositoryformatversion = 0
filemode = false
@TakashiSasaki
TakashiSasaki / hello.txt
Created June 7, 2012 10:13
松重くん、佐々木です。
まず自分のアカウントでgithubにログインします。
gist というボタンをクリックするか、 http://gist.github.com/ にアクセスすると
自分専用のファイル貼り付けスペースが見えるはずです。
一番上の欄にファイルの簡単な説明を、
その下の欄にファイル名を記入します。
ファイルの内容を一番大きなこのボックスに貼り付けます。
「Create Public Gist」をクリックすると共有完了です。
そのURL( https://gist.github.com/gists/数字 )を教えて下さい。
また、 https://gist.github.com/アカウント名 で自分が貼りつけたファイルを閲覧することができます。
# Auto detect text files and perform LF normalization
* text=auto
# Custom for Visual Studio
*.cs diff=csharp
*.sln merge=union
*.csproj merge=union
*.vbproj merge=union
*.fsproj merge=union
*.dbproj merge=union
@TakashiSasaki
TakashiSasaki / readme.md
Created October 10, 2015 07:51
GasGistのテストのためのpublic gist

GasGistのテストのためのpublic gistです。

@TakashiSasaki
TakashiSasaki / .hgrc
Created December 22, 2012 08:02
Mercurial (hg)を使うにあたって、まずはpurge extensionとconvert extensionは使えるようにしておかないと不便。
[extensions]
hgext.purge=
hgext.convert=
[ui]
username = Takashi SASAKI <takashi-sasaki@example.com>