This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" | |
csvから文字列を探して位置を返す | |
# 入力形式. csvが渡されることを想定 | |
"Z","T","A","V", | |
"P","G","P","N", | |
# 出力形式 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> import dateutil.parser | |
>>> print dateutil.parser.parse('Oct 3 12:00:00') | |
2014-10-03 12:00:00 | |
>>> type(dateutil.parser.parse('Oct 3 12:00:00')) | |
<type 'datetime.datetime'> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="http://www.google.com/jsapi"></script> | |
<script>google.load('jquery', 1);</script> | |
<script src="http://twitter.github.com/hogan.js/builds/2.0.0/hogan-2.0.0.js"></script> | |
<script> | |
$(function() { | |
function callAPI (method, url, async){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# | |
# Get uuid by blkid output. | |
# :param blkid: str | |
# :param target: str | |
# :rtype :str | |
# | |
import json | |
import sys | |
import shlex |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import json | |
import sys | |
import shlex | |
from ansible.module_utils.basic import * | |
DOCUMENTATION = ''' | |
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*.bin | |
*.swp | |
*.bak | |
*.old | |
*.egg | |
*.egg-info | |
*.crt | |
*.key | |
*.pem | |
*.pub |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function setPhoto() | |
{ | |
$options = array( | |
'file_src' => '', | |
'is_image' => true, | |
'with_delete' => false, | |
'template' => get_partial('default/formEditImage', array('image' => $this->getObject())), | |
); | |
$this->setWidget('photo', new sfWidgetFormInputFileEditable($options, array('size' => 40))); | |
$this->setValidator('photo', new opValidatorImageFile(array('required' => false))); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
class Hoge(object): | |
def foo(self, num): | |
""" | |
0~num-1までの数字をリスト形式で作成する | |
>>> a = Hoge() | |
>>> a.foo(5) | |
[0, 1, 2, 3, 4] | |
""" | |
return [e for e in range(num)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# coding: utf-8 | |
"""myprofiler - Casual MySQL Profiler | |
https://github.com/methane/myprofiler | |
""" | |
import os | |
import sys |
OlderNewer