Skip to content

Instantly share code, notes, and snippets.

@ha1t
ha1t / sevseg_ex2.ino
Created August 29, 2015 03:43
SevSeg + FlexiTimer2
#include <SevSeg.h>
#include <FlexiTimer2.h>
SevSeg sevseg; //Instantiate a seven segment object
void setup() {
byte numDigits = 4;
byte digitPins[] = {3, 2, 1, 0};
byte segmentPins[] = {11, 10 ,9 ,8, 7, 6, 5, 4};
//sevseg.begin(COMMON_CATHODE, numDigits, digitPins, segmentPins);
#include "SevSeg.h"
SevSeg sevseg; //Instantiate a seven segment controller object
void setup() {
byte numDigits = 4;
byte digitPins[] = {3, 2, 1, 0};
byte segmentPins[] = {11, 10 ,9 ,8, 7, 6, 5, 4};
//sevseg.begin(COMMON_CATHODE, numDigits, digitPins, segmentPins);
#!/usr/bin/env ruby
require 'open-uri'
def get_ip_address()
ip_url = 'http://checkip.dyndns.org/'
ip_addr = open(ip_url).read.scan(/\<body\>.*?:(.*?)\<\/body\>/)[0][0].strip
ip_addr
end
@ha1t
ha1t / mousemove.ino
Last active November 3, 2016 15:50
マウスカーソルをぷるぷるさせる
// 1.6.10 だと動かない.1.6.11でうごいた
#include <Mouse.h>
void setup() {
Mouse.begin();
}
void loop() {
Mouse.move(2, 2);
SHIFT_KEY = 23
SHIFT_1 = 1
SHIFT_2 = 2
function OnEvent(event, arg, family)
if (event == "PROFILE_ACTIVATED") then
SetMKeyState(SHIFT_1, "lhc")
end
if (family == "lhc" and event == "G_PRESSED" and arg == SHIFT_KEY) then
package main
import (
php "./php"
"io"
"net/http"
"os"
"path/filepath"
"runtime"
"strings"
/// <reference path="../chatwork.d.ts" />
var __extends = this.__extends || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
__.prototype = b.prototype;
d.prototype = new __();
};
var ChatworkExtension;
(function (ChatworkExtension) {
//
<?php
/**
*
*
*/
$array = array('hoge', 'huga', 'moge');
$result_1 = array();
foreach ($array as $item) {
$result_1[] = $item . '_1';
@ha1t
ha1t / find_feed.php
Created September 2, 2014 07:58
指定URLからfeedを探す
<?php
/**
* 指定URLからfeedを探す
*
*/
header('Content-Type: text/html; charset=UTF-8');
function discover($url)
{
$api_url = 'http://rpc.reader.livedoor.com/feed/discover?format=json';
##
#
# @url http://www.ruby-lang.org/ja/man/html/Win32API.html
# @url http://delfusa.main.jp/delfusafloor/archive/www.nifty.ne.jp_forum_fdelphi/faq/00028.htm
#
require 'Win32API'
class Win32API
# type flag