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 / customize_default.json
Created December 13, 2015 04:57
customize_default.json
{
"app": 19,
"scope": "ALL",
"desktop": {
"js": [{
"type": "URL",
"url": "https://js.cybozu.com/jquery/1.11.3/jquery.min.js"
}, {
"type": "URL",
"url": "https://js.cybozu.com/jqueryui/1.11.4/jquery-ui.min.js"
@yamaryu0508
yamaryu0508 / ひらがなのUTF8コード(文字→コード)
Created December 13, 2015 04:34
ひらがなのUTF8コード(文字→コード)
{
"ァ": "E382A1",
"ア": "E382A2",
"ィ": "E382A3",
"イ": "E382A4",
"ゥ": "E382A5",
"ウ": "E382A6",
"ェ": "E382A7",
"エ": "E382A8",
"ォ": "E382A9",
@yamaryu0508
yamaryu0508 / ひらがなのUTF8コード(コード→文字)
Last active December 13, 2015 04:30
全角カタカナのUTF8コード(コード→文字)
{
"E382A1": "ァ",
"E382A2": "ア",
"E382A3": "ィ",
"E382A4": "イ",
"E382A5": "ゥ",
"E382A6": "ウ",
"E382A7": "ェ",
"E382A8": "エ",
"E382A9": "ォ",
{
"ぁ": "3041",
"あ": "3042",
"ぃ": "3043",
"い": "3044",
"ぅ": "3045",
"う": "3046",
"ぇ": "3047",
"え": "3048",
"ぉ": "3049",
{
"3041": "ぁ",
"3042": "あ",
"3043": "ぃ",
"3044": "い",
"3045": "ぅ",
"3046": "う",
"3047": "ぇ",
"3048": "え",
"3049": "ぉ",
@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();
}
});
@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 / 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 / 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 / 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オブジェクトを取得