Skip to content

Instantly share code, notes, and snippets.

@hm0429
hm0429 / exchangerate_sgd_jpy.rb
Last active September 3, 2015 00:14
Ruby で 為替レート を取得(SGD/JPY)
require 'open-uri'
require 'json'
BASE_URI = "https://openexchangerates.org/api/"
API = "latest.json"
## APP_ID は API key のようなものです。openexchangerates.org 登録すると発行されます。
APP_ID = "YOUR_APP_ID"
uri = BASE_URI + API + "?app_id=" + APP_ID
SELECT * FROM table;
@hm0429
hm0429 / gist:ae0d3d95d4c1d4a0cb87
Last active October 7, 2015 15:42
SQL: データの挿入
INSERT INTO table (column_1, column_2, column_3) VALUES (value_1, value_2, value_3)
@hm0429
hm0429 / gist:1f7aec368a0eb3dabf7e
Last active October 7, 2015 15:42
SQL: テーブルの作成
CREATE TABLE table (
column_1 data_type,
column_2 data_type,
column_3 data_type
);
 
@hm0429
hm0429 / gist:0043aad35d8edcac74ff
Created October 7, 2015 15:43
SQL: テーブルにカラムを追加
ALTER TABLE table ADD COLUMN column data_type;
@hm0429
hm0429 / gist:00442abc7ffe285b5247
Created October 7, 2015 15:47
SQL: データの更新
UPDATE table
SET update_column = update_value
WHERE condition_column = condition_value;
@hm0429
hm0429 / gist:fce80ea7a9e3cb2cfe96
Created October 7, 2015 15:48
SQL: データの削除
DELETE FROM table
WHERE condition_column IS condition_value;
// Required to include #include <sys/sysctl.h>
- (BOOL)isTSMC {
size_t size;
sysctlbyname("hw.model", NULL, &size, NULL, 0);
char *model = (char*)malloc(size);
sysctlbyname("hw.model", model, &size, NULL, 0);
NSString *modelName = [NSString stringWithCString:model encoding:NSUTF8StringEncoding];
free(model);
NSLog(@"modelName: %@", modelName);
@hm0429
hm0429 / Arduino_LED_Blink.ino
Last active October 16, 2015 13:48
Arduino_LED_Blink
@hm0429
hm0429 / Arduino_Button.ino
Created October 16, 2015 14:08
Arduino_Button
#define LED_PIN 13
#define BUTTON_PIN 7
void setup() {
// LED_PIN (PIN 13) を OUTPUT として設定します
pinMode(LED_PIN, OUTPUT);
pinMode(BUTTON_PIN, INPUT);
}