| 更新: | 2013-11-05 |
|---|---|
| バージョン: | 0.1.7 |
| 作者: | @voluntas |
| URL: | http://voluntas.github.io/ |
概要
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| # それっぽいデータを作る処理 | |
| from datetime import datetime, timedelta | |
| import scipy | |
| import scipy.stats | |
| def create_dummy_data(days): | |
| x = np.linspace(2, 2 + days, days) | |
| y = scipy.stats.norm.pdf(x, loc=0, scale=4) * 4 + 0.15 |
| #!/opt/local/bin/zsh | |
| IMG_FILENAME=`date +'%Y-%m-%d %H:%M'`.png | |
| /usr/sbin/screencapture -x ~/tmp/capture/$IMG_FILENAME |
| define(['utils', 'template'], function (Utils, JST) { | |
| 'use strict'; | |
| function render() { | |
| // テンプレート使ってレンダリングする例 | |
| $('#target').html(JST['app/templates/fuga.ejs'], {images: [],....}); | |
| // 画像を60px * 60pxの枠に納めるとする | |
| var adjustFn = Utils.createImageAdjustFn(60, 60); | |
| $('#target .profile img').on('load', function() { |
| # -*- coding: utf-8 -*- | |
| import argparse | |
| import json | |
| import urllib | |
| parser = argparse.ArgumentParser(description="Fetch Youtube movie info by movie id", | |
| formatter_class=argparse.RawDescriptionHelpFormatter, | |
| epilog='Ex: python fetch_ytmovie.py rMHdqOyp6tc' | |
| ) |
| import socket | |
| import time | |
| import threading | |
| def server(): | |
| server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
| server_socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) | |
| server_socket.bind(('localhost', 9999)) | |
| server_socket.listen(1) |
| # -*- coding: utf-8 -*- | |
| import time | |
| import threading | |
| import zmq | |
| def server(): | |
| print('Start server') |
| 更新: | 2013-11-05 |
|---|---|
| バージョン: | 0.1.7 |
| 作者: | @voluntas |
| URL: | http://voluntas.github.io/ |
概要
| <!doctype html> | |
| <html> | |
| <head> | |
| <title>Touch Event Test</title> | |
| <meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, maximum-scale=1.0, target-densityDpi=device-dpi" /> | |
| <style> | |
| html { | |
| height: 100%; | |
| } | |
| body { |
| let OSTYPE = system('uname') | |
| if OSTYPE == "Darwin\n" | |
| set noswapfile | |
| set nowritebackup | |
| endif |
| # -*- coding: utf-8 -*- | |
| import boto.sns | |
| AWS_ACCESS_KEY = 'xxxx' | |
| AWS_SECRET_ACCESS_KEY = 'yyyyyyyy' | |
| APPLICATION_ARN = 'arn:aws:sns:ap-northeast-1:0000:app/APNS_SANDBOX/aaaa' | |
| # SNSに接続 | |
| sns_connection = boto.sns.connect_to_region('ap-northeast-1', |