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 asyncio | |
import cozmo | |
from cozmo.objects import CustomObject, CustomObjectMarkers, CustomObjectTypes | |
from cozmo.util import degrees, distance_mm | |
def create_custom_cube(world, obj_type, maker): | |
return world.define_custom_cube(obj_type, maker, 44, 30, 30, True) |
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 asyncio | |
import cozmo | |
from cozmo.objects import CustomObject, CustomObjectMarkers, CustomObjectTypes | |
from cozmo.util import degrees, distance_mm | |
def create_custom_cube(world, obj_type, maker): | |
return world.define_custom_cube(obj_type, maker, 44, 30, 30, True) |
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
var rss = 'https://www3.nhk.or.jp/rss/news/cat0.xml'; | |
$.ajax({ | |
url: rss, | |
format: 'xml' | |
}).done(function(data) { | |
$(data).find("item").each(function(i) { | |
var $el = $(this); | |
console.log(i); | |
console.log($el.find('title').text()); | |
console.log($el.find('link').text()); |
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 -*- | |
"""Simple Proxy Server. | |
Response Headerに "Access-Control-Allow-Origin: *" を追加して返す簡易Proxyサーバ | |
Usage: | |
python simple_proxy_server.py | |
""" |
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/bash | |
NAME1="Haruka!" | |
echo "Hello, ${NAME1}" |
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 method1(self): | |
print('call method1()') | |
if __name__ == '__main__': | |
hoge = Hoge() | |
print(getattr(hoge, 'method1', None)) # => method1 |
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
from __future__ import with_statement | |
from alembic import context | |
from sqlalchemy import engine_from_config, pool | |
from logging.config import fileConfig | |
### modelsをインポートするためにパスを追加 ### | |
import os | |
import sys | |
root_dir = os.getcwd() | |
sys.path.insert(0, root_dir) |
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 argparse | |
import wikipedia | |
def get_parser(): | |
parser = argparse.ArgumentParser() | |
parser.add_argument('query', type=str, help='the question to answer') | |
parser.add_argument('--lang', type=str, help='select language(default: en)', default='en') | |
return parser |
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
print('Helli, Python!') |
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
print('Hello, gist!') |