Skip to content

Instantly share code, notes, and snippets.

View yamaryu0508's full-sized avatar

Ryu Yamashita yamaryu0508

  • Kintone Corporation
  • San Francisco
View GitHub Profile
@yamaryu0508
yamaryu0508 / kintone-fileUpload.vb
Last active December 18, 2023 13:39
Excel-VBAによるサイボウズkintoneへのバイナリファイルアップロードのサンプル
Sub fileUpload()
''''''''
' http://trash-area.com/archives/649 を参考に作成
''''''''
' ファイルの情報設定
localfileName = "c:\photo3.jpg" 'アップロード元のファイル
FileName = "image.jpeg" 'アップロード後のファイル名
mimeType = "image/jpeg" 'ファイルのmime-type
' kintoneアクセス情報の設定
subdomain = "[your subdomain]" 'サブドメイン
@yamaryu0508
yamaryu0508 / kintonepy2.py
Last active August 29, 2015 14:01
Pythonによるkintoneのライトなリクエストライブラリ(Python2.7)
# coding: utf-8
import httplib, urllib, urlparse, base64, json
#
class kintone:
def __init__(self, host, id, passWord):
self.host = host
self.id = id
self.passWord = passWord
self.authToken = base64.b64encode(id+":"+passWord)
@yamaryu0508
yamaryu0508 / RasPi2Typetalk.py
Last active August 29, 2015 14:02
Raspberry Pi上にアタッチした温度センサ(ADT7410)からの値をTypetalkに渡すサンプル
# coding: utf-8
import smbus
import time
import requests
# config for I2C and ADT7410
i2c = smbus.SMBus(1)
address = 0x48
@yamaryu0508
yamaryu0508 / RPi2kintone.py
Last active August 29, 2015 14:02
Raspberry Pi上にアタッチした温度センサ(ADT7410)とカメラ(ELECOM UCAM-C0113FBBK)からkintoneへの連携
# coding: utf-8
#
#
# import libraries
import smbus
import time
import commands
import urllib2, json, requests
##
## set interval
@yamaryu0508
yamaryu0508 / getRecordsFromKintone.R
Last active August 29, 2015 14:04
Rにシンプルなkintoneリクエスト(GET)スニペット
library(RCurl)
library(rjson)
uri <- "https://{subdomain}.cybozu.com/k/v1/records.json?app=560" # URIのセット
authToken <- base64("{id}:{password}") # 認証情報のセット
headers <- c('X-Cybozu-Authorization' = authToken) # ヘッダのセット
requestBody <- paste('{}') # リクエストボディのセット(GETの場合も'{}'としてセット)
responseJson <- getURL(uri, customrequest="GET", postfields=requestBody, httpheader=headers, ssl.verifypeer = FALSE) # HTTPSリクエスト
response <- fromJSON(responseJson) # レスポンスJSONからRオブジェクトを取得
@yamaryu0508
yamaryu0508 / adt7410.py
Last active October 5, 2015 07:08
I2C温度センサーADT7410のIoT(M2M)スクリプト
# coding: utf-8
import smbus
import time
import urllib2, json, requests
INTERVAL = 60*1 # second
ADDRESS = 0x48
CHANNEL = 1
@yamaryu0508
yamaryu0508 / adt7410.js
Last active August 29, 2015 14:11
I2C温度センサーADT7410のIoT(M2M)スクリプト
var ADDRESS, API_KEY, FEED_ID, async, i2c, INTERVAL, readValue, registToXively, request, sensor;
i2c = require('i2c');
request = require('request');
async = require('async');
ADDRESS = 0x48;
INTERVAL = 60*1000; // mili-sec
sensor = new i2c(ADDRESS, {device: '/dev/i2c-1'});
@yamaryu0508
yamaryu0508 / snippets.cson
Last active August 29, 2015 14:18
Atom用kintone-JSスニペット(autocomplete-plusとautocomplete-snippetsが前提)
# Your snippets
#
# Atom snippets allow you to enter a simple prefix in the editor and hit tab to
# expand the prefix into a larger code block with templated values.
#
# You can create a new snippet in this file by typing "snip" and then hitting
# tab.
#
# An example CoffeeScript snippet to expand log to console.log:
#
@yamaryu0508
yamaryu0508 / hello-noble.js
Created November 23, 2015 14:15
nobleでペリフェラルの情報を一通り表示する
var noble = require('noble');
noble.on('stateChange', function(state) {
if (state === 'poweredOn') {
noble.startScanning();
} else {
noble.stopScanning();
}
});
{
"3041": "ぁ",
"3042": "あ",
"3043": "ぃ",
"3044": "い",
"3045": "ぅ",
"3046": "う",
"3047": "ぇ",
"3048": "え",
"3049": "ぉ",