Skip to content

Instantly share code, notes, and snippets.

View youkidearitai's full-sized avatar

tekimen youkidearitai

View GitHub Profile
const int BEEP = 3; /* pin no */
void setup() {
Serial.begin(9600);
pinMode(BEEP, OUTPUT);
}
void loop() {
int analogPin = analogRead(0);
int outputLevel = analogPin / 4;
<?php
if (empty($argv[1]) || preg_match('/\A[0-9]+\z/', $argv[1]) !== 1) {
throw new Exception('Usage: fizzbuzz.php number [separator]');
}
$array = range(1, (int)$argv[1]);
$separator = isset($argv[2]) ? $argv[2] : PHP_EOL;
echo implode($separator, array_map(function($i) {
@youkidearitai
youkidearitai / hello.txt
Created September 13, 2014 08:07
test gist-vim plugin
Hello World
@youkidearitai
youkidearitai / fizzbuzz.py
Created September 14, 2014 09:09
初めてのpython
#!/usr/env/bin python
# -*- coding: utf-8 -*-
import sys
def fizzbuzz(i):
if i % 3 == 0 and i % 5 == 0:
return 'fizzbuzz'
elif i % 3 == 0:
return 'fizz'
#!/usr/bin/env python
def fizzbuzz(func):
def fb():
value = func()
if (value % 3 == 0 and value % 5 == 0):
return 'FizzBuzz'
elif (value % 3 == 0):
return 'Fizz'
elif (value % 5 == 0):
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
arr = [3, 8, 1, 9, 18, 44]
try:
search = int(sys.argv[1])
except IndexError:
#!/usr/bin/env python
# -*- conding: utf-8 -*-
def search(l, value):
low = 0
high = len(l) - 1
while(low <= high):
lx = int((low + high) / 2)
#!/usr/bin/env python
# -*- coding: utf-8 -*-
def loadTable(l, size):
a = []
for i in range(0, size):
a.append([])
for i in range(0, len(l) - 1):
h = l[i] % size
#!/usr/bin/env python
# -*- conding: utf-8 -*-
class Node:
left = None
right = None
value = None
def __init__(self, value):
#!/usr/bin/env python
# -*- coding: utf-8 -*-
class Node:
def __init__(self):
self.children = []
def getName(self):
pass