Skip to content

Instantly share code, notes, and snippets.

Ando takuya-andou

Block or report user

Report or block takuya-andou

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
takuya-andou / LineBotBeaconAPI.php
Created Oct 6, 2016
View LineBotBeaconAPI.php
$json_string = file_get_contents('php://input');
$json_object = json_decode($json_string);
$AndoUserID = '<<LineUserID>>';
error_log("callback start.");
foreach ($json_object->events as $event) {
if('message' == $event->type){
if ($event->source->userId == $AndoUserID) {
if ($event->message->text =='おは'){
takuya-andou /
Created Aug 28, 2017
# -*- coding: utf-8 -*-
import sys
import qrcode
# QRコードを作る場合
URLarray = ['','']
for i, URL in enumerate(URLarray):
img = qrcode.make(URL) # ''内の文字をQRコードに変換'qr_img' + str(i) + '.png') # QRコードに名前をつけて保存
takuya-andou /
Created Aug 28, 2017
# coding:utf-8
import sys
import re
from urllib2 import urlopen as U, Request as R
from json import loads as J
API_KEY = "ここはGoogleのAPIを取得して使う"
API = "" + API_KEY
View piano.js
const DashButton = require('dash-button');
const {exec} = require('child_process');
const do1 = new DashButton("xx:xx:xx:xx:xx:xx"); //じゃがりこ
const re = new DashButton("xx:xx:xx:xx:xx:xx"); //パンテーン
const mi = new DashButton("xx:xx:xx:xx:xx:xx"); //ヘルシア
const fa = new DashButton("xx:xx:xx:xx:xx:xx"); //カロリーメイト
const so = new DashButton("xx:xx:xx:xx:xx:xx"); //エヴィアン
const ra = new DashButton("xx:xx:xx:xx:xx:xx"); //アマゾンベーシック
const si = new DashButton("xx:xx:xx:xx:xx:xx"); //シーブリーズ
takuya-andou /
Created Dec 13, 2016
Amazon Dash Button launches Steve
# coding: utf-8
from scapy.all import *
from picraft import World, Vector, Block
world = World("MineCraftServer IP")
def arp_display(pkt):
if pkt[ARP].op == 1:
if pkt[ARP].hwsrc == 'Your AmazonDashButton's Mac Address':
world.player.pos = Vector(0, 300, 0)
takuya-andou / cronfile.js
Created Dec 10, 2015
myThings + milkcocoaで高齢者見守りデバイスを作ってみた ref:
View cronfile.js
var MilkCocoa = require('milkcocoa');
var milkcocoa = new MilkCocoa('********');
var history = milkcocoa.dataStore('door').history();
var execSync = require('child_process').execSync;
var myD = new Date();
var myYear = myD.getFullYear();
var myMonth = myD.getMonth();
'''This script goes along the blog post
"Building powerful image classification models using very little data"
It uses data that can be downloaded at:
In our setup, we:
- created a data/ folder
- created train/ and validation/ subfolders inside data/
from scipy.misc import imread, imresize
from keras.layers import Input, Dense, Convolution2D, MaxPooling2D, AveragePooling2D, ZeroPadding2D, Dropout, Flatten, merge, Reshape, Activation
from keras.models import Model
from keras.regularizers import l2
from keras.optimizers import SGD
from googlenet_custom_layers import PoolHelper,LRN
def create_googlenet(weights_path=None):
takuya-andou / file0.txt
Created Jul 6, 2016
Labellioで作った分類器を自前のubuntuで動かそうとした時に出たエラーと解決策 ref:
View file0.txt
Gdk-CRITICAL **: gdk_cursor_new_for_display: assertion 'GDK_IS_DISPLAY (display)' failed
Traceback (most recent call last):
File "", line 8, in <module>
from labellio import Classifier, Config, ImageLoader, Label
File "/usr/local/lib/python2.7/dist-packages/labellio/", line 2, in <module>
from labellio.classifier import Classifier
File "/usr/local/lib/python2.7/dist-packages/labellio/", line 6, in <module>
from import Net
File "/usr/local/lib/python2.7/dist-packages/labellio/", line 4, in <module>
import caffe
takuya-andou / file0.txt
Created Jul 5, 2016
angular2でページ読み込み後に処理を実行する方法 ref:
View file0.txt
import {Component, AfterViewInit} from 'angular2/core';
selector: 'home',
templateUrl: './components/home/home.html'
export class HomeCmp implements AfterViewInit {
ngAfterViewInit() {
You can’t perform that action at this time.