Skip to content

Instantly share code, notes, and snippets.

Avatar

Hideyoshi Moriya hm0429

View GitHub Profile
@hm0429
hm0429 / exchangerate_sgd_jpy.rb
Last active Sep 3, 2015
Ruby で 為替レート を取得(SGD/JPY)
View exchangerate_sgd_jpy.rb
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
@hm0429
hm0429 / gist:ae0d3d95d4c1d4a0cb87
Last active Oct 7, 2015
SQL: データの挿入
View gist:ae0d3d95d4c1d4a0cb87
INSERT INTO table (column_1, column_2, column_3) VALUES (value_1, value_2, value_3)
@hm0429
hm0429 / gist:1f7aec368a0eb3dabf7e
Last active Oct 7, 2015
SQL: テーブルの作成
View gist:1f7aec368a0eb3dabf7e
CREATE TABLE table (
column_1 data_type,
column_2 data_type,
column_3 data_type
);
 
@hm0429
hm0429 / gist:0043aad35d8edcac74ff
Created Oct 7, 2015
SQL: テーブルにカラムを追加
View gist:0043aad35d8edcac74ff
ALTER TABLE table ADD COLUMN column data_type;
View gist:00442abc7ffe285b5247
UPDATE table
SET update_column = update_value
WHERE condition_column = condition_value;
View gist:fce80ea7a9e3cb2cfe96
DELETE FROM table
WHERE condition_column IS condition_value;
View gist:858de4b8b40345389c24
// 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 Oct 16, 2015
Arduino_LED_Blink
View Arduino_LED_Blink.ino
View Arduino_Button.ino
#define LED_PIN 13
#define BUTTON_PIN 7
void setup() {
// LED_PIN (PIN 13) を OUTPUT として設定します
pinMode(LED_PIN, OUTPUT);
pinMode(BUTTON_PIN, INPUT);
}
You can’t perform that action at this time.