#『プログラミングの基礎』社内読書会 #0
func handleKeyboardWillShowNotification(notification: NSNotification) { | |
if self.inputContainerViewBottomLayoutGuideConstraint.constant == 0 { | |
keyboardWillChangeFrameWithNotification(notification, showKeyboard: true) | |
scrollBubbleTableViewToBottomAnimated(true) | |
} | |
} | |
func handleKeyboardWillHideNotification(notification: NSNotification) { | |
if self.inputContainerViewBottomLayoutGuideConstraint.constant > 0 { | |
keyboardWillChangeFrameWithNotification(notification, showKeyboard: false) |
# Python file downloader for Pythonista by OMZ Software | |
# By: EJM Software ---- http://ejm.cloudvent.net | |
# Source: https://gist.github.com/89edf288a15fde45682a | |
# ***************************************** | |
# This simple script uses the requests module to download files | |
# and the ui module to show a progress bar | |
# You can use this bookmarklet to download files from Safari: | |
# javascript:window.location='pythonista://filedownloader?action=run&argv='+encodeURIComponent(document.location.href); | |
import ui, console, clipboard, sys, requests, zipfile |
Sublime Textの検索窓に日本語を入力するとEnterを押すなり文字が消えてしまうのですが、無理やり解決する方法を見つけました。ググってもこちらのバグレポートしか見つからなかったので報告です。
わたしの環境はMac OS XのSublime Text 3 (Build 3059)ですが、この解決方法はSublime Text 2 (Build 2220)にも対応しています。Windowsの場合は不明です。
このステップはSublime Text 3の場合のみ必要です。Sublime Text 2の場合はステップ2に行って下さい。
protocol ArrayRepresentable { | |
typealias ArrayType | |
func toArray() -> ArrayType[] | |
} | |
extension Range : ArrayRepresentable { | |
func toArray() -> T[] { | |
return T[](self) | |
} |
@echo off | |
set dt=%date% | |
set tm=%time: =0% | |
set d=%dt:~2,2%%dt:~5,2%%dt:~8,2% | |
set t=%tm:~0,2%%tm:~3,2%%tm:~6,2% | |
psql -U user -L %d%_%t%.log test |
# bad | |
def compute_thing(thing) | |
if thing[:foo] | |
update_with_bar(thing) | |
if thing[:foo][:bar] | |
partial_compute(thing) | |
else | |
re_compute(thing) | |
end | |
end |
http://co3k.org/blog/csrf-token-should-not-be-session-id について。
この記事では触れられていませんが、
- むかし、セッションIDをHTMLソース中に埋め込んでも脅威は変わらないと主張した人がいました
- 正確には「hiddenの値のみ漏れやすいような特殊な脆弱性が無ければ」という前提であったけれど、実際にそのようなバグはあったし、予見されていた。
- とても影響のある人だったので、色々なサイトや書籍がその方法を紹介し、安全なウェブサイトの作り方にも載ってしまいました
この際ハッキリ言っておくべきだと思うので書きますが、そもそもセッションIDを(HTMLソース中に埋め込む)CSRF対策トークンとして使うのは間違いでした。最初から間違っていたのです。正確に言うとCSRFの話は関係ないですね。CSRF関係なく、特に「単体で」セッションハイジャックが可能になるような値を、HTMLソース中に埋め込むべきではありません。
あげあげ (☝◞‸◟)☝ 顔文字 | |
あげあげ ( ☝՞ਊ ՞)☝ 顔文字 | |
あっあっ (◞‸◟;) 顔文字 | |
あつい (。>﹏<) 顔文字 | |
あわてる ヽ( ̄д ̄;)ノ=3=3=3 顔文字 | |
いう ( ^o^)< 名詞 | |
いしはらよしずみ 三( ◠‿◠ )そんな時にタウンページが便利なんですよ 顔文字 | |
うーにゃー (」・ω・)」うー!(/・ω・)/にゃー 名詞 | |
うーん :;(∩´﹏`∩);: 顔文字 | |
うっとり ・:*:・(*´∀`*)・:*:・ 顔文字 |
Here's an example application that uses the pattern detailed below: https://github.com/tantastik/talent-curator
This document is an attempt to describe the first step of a large project structure with flask and some basic modules:
- SQLAlchemy
- WTForms
Please feel free to fix and add your own tips.