This file contains hidden or 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 -*- | |
import time | |
import threading | |
import zmq | |
def server(): | |
print('Start server') |
This file contains hidden or 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 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) |
This file contains hidden or 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 -*- | |
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' | |
) |
This file contains hidden or 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
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() { |
This file contains hidden or 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
#!/opt/local/bin/zsh | |
IMG_FILENAME=`date +'%Y-%m-%d %H:%M'`.png | |
/usr/sbin/screencapture -x ~/tmp/capture/$IMG_FILENAME |
This file contains hidden or 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 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 |
This file contains hidden or 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
@interface NSObject (Debounce) | |
- (void)debounce:(SEL)action delay:(NSTimeInterval)delay; | |
@end |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
OlderNewer