Skip to content

Instantly share code, notes, and snippets.

ir_sensor <- hardware.pin2;
ir_sensor.configure(DIGITAL_IN);
led <- hardware.pin1;
led.configure(DIGITAL_OUT, 0);
ir_value <- 0;
led_state <- 0;
function poll() {
@kironono
kironono / ios8_mobile_safari_select_element_test.html
Last active August 29, 2015 14:07
iOS 8.0 (12A356) Mobile Safari でセレクトボックスを開いただけで onchange イベントが発火する
<html>
<body>
<h1>It works!</h1>
<select id="testbox" name="hoge" onchange="alert('test');">
</select>
<script src="//code.jquery.com/jquery-1.11.0.min.js"></script>
<script>
@kironono
kironono / hello.py
Last active August 29, 2015 14:05
はろーわーるど
# coding: utf-8
def main():
print(u"こんにちは、世界")
if __name__ == '__main__':
main()
#! /bin/sh
STATE_OK=0
STATE_WARNING=1
STATE_CRITICAL=2
STATE_UNKNOWN=3
STATE_DEPENDENT=4
mysqlpath='/usr/bin'
null="NULL"
usage1="Usage: $0 -H <host> [-P <port>] -u <user> -p <password>"
@kironono
kironono / gist:7250208
Last active December 27, 2015 02:09
蒼き鋼のアルペジオ -アルス・ノヴァ- #4 「横須賀急襲」で出てきたプログラムコード 霧の戦隊 大戦艦 ハルナ 読み取れたところまで
/* 霧の戦隊 大戦艦 ハルナ */
printf("total energy |E| of helium atom (eV) ? ");
scanf("%lf", &E);
for (i=1; i < 100 ;i++) { /* repeat until r1 = initial r1 + 100 */
/* poten = potential energy */
poten =-(2.0*Z*ele*ele)/(4.0*pai*epsi*r)+(ele*ele)/(4.0*pai*epsi*2.0*r);
/* vya = total E-potential energy */
// bit set / clear
#ifndef cbi
#define cbi(PORT, BIT) (_SFR_BYTE(PORT) &= ~_BV(BIT))
#endif
#ifndef sbi
#define sbi(PORT, BIT) (_SFR_BYTE(PORT) |= _BV(BIT))
#endif
#define TIMER_PWM_PIN 3
#define TIMER_DISABLE_INTR (TIMSK2 = 0)
#define INPUT_PIN 8
#define LED_PIN 13
#define COUNT_NUM 512
unsigned int data[COUNT_NUM];
void setup() {
pinMode(INPUT_PIN, INPUT);
pinMode(LED_PIN, OUTPUT);
Serial.begin(9600);