Skip to content

Instantly share code, notes, and snippets.

@iseebi
iseebi / blexplr_proxy.rb
Created April 26, 2013 18:37
Bluetooth LEアプリ開発者必携ツール BLExplr に俺 UUID 食わせるためのプロキシ
#!/usr/bin/env ruby
require 'webrick'
require 'webrick/httpproxy'
SCRIPT_DIR = File.expand_path(File.dirname(__FILE__))
handler = Proc.new() {|req,res|
if req.unparsed_uri =~ %r!http://ios.mkroll.mobi/BLExplr/uuids-date-time.txt!
text = File.open(SCRIPT_DIR + "/uuids-date-time.txt") {|f| f.read }
@iseebi
iseebi / KonashiManager.java
Last active December 16, 2015 17:09
Konashi を Motorola RAZA IS11M (Motorola BLE API) で使おうとした件。 とりあえずつながってタクトスイッチのON/OFFとチェックボックスが同期するサンプルになったけど、SDKとしてまとめきる前にめんどくなって挫折。
package net.iseteki.example.konashiRAZRSample;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothGattService;
import android.bluetooth.IBluetoothGattProfile;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
@iseebi
iseebi / sudden.hs
Last active December 15, 2015 11:29
すごいHaskell読書会 #7 課題
import Data.Char
import Data.List
import System.Environment
charLen :: (Num a) => Char -> a
charLen c
| (ord c) <= 255 = 1
| otherwise = 2
multibyteStringLen :: (Num a) => String -> a
@iseebi
iseebi / work.hs
Created February 13, 2013 11:57
すごいHaskell読書会 #5 練習問題解答 (途中まで)
import Data.List
data Bookmark = Bookmark String String | Folder String [Bookmark]
deriving (Show)
folder1 = Folder "Search Engines" [Bookmark "Google" "http://www.google.com/", Bookmark "Yahoo" "http://www.yahoo.com/"]
folder2 = Folder "Social Networks" [Bookmark "Twitter" "http://twitter.com/", Bookmark "Facebook" "http://www.facebook.com/", Bookmark "mixi" "http://www.mixi.jp/"]
bookmarks = Folder "Root" [folder1, folder2, Bookmark "Fenrir Inc." "http://www.fenrir-inc.com/"]
bookmark2json :: Bookmark -> String
@iseebi
iseebi / Geometry.hs
Created February 1, 2013 14:41
すごいHaskell読書会 in 大阪 スライド中のコード
module Geometry
( sphereVolume
, sphereArea
, cubeVolume
, cubeArea
, cuboidVolume
, cuboidArea
) where
sphereVolume :: Float -> Float
@iseebi
iseebi / MainPage.xaml
Created November 10, 2012 05:02
Protected password store in Windows Phone
<phone:PhoneApplicationPage
x:Class="ProtectedDataSample.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="768"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
@iseebi
iseebi / MyGridView.cs
Created July 14, 2012 05:34
MetroStyleDeveloper#04 Demo
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using GridApp1.Data;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
namespace GridApp1
@iseebi
iseebi / ConnectionInformation.cs
Created June 27, 2011 15:01
EbiSoft.EbIRC.IRC.IRCClient in Siverlight for Windows Phone
using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
@iseebi
iseebi / FilenameProcessing.bas
Created May 18, 2011 05:58
Excel VBA Macro for Filename processing
Option Explicit
Function dirname(ByVal inVal As String, Optional directorySeparater As String = "/") As String
Dim basenameStr As String
basenameStr = basename(inVal, directorySeparater)
If basenameStr <> inVal Then
dirname = Left(inVal, Len(inVal) - Len(basenameStr) - 1)
Else
dirname = "."
End If
@iseebi
iseebi / WindowsPhone7.xml
Created January 25, 2011 11:53
Windows Phone 7 accent color swatch library xml for Expression Design
<?xml version="1.0" encoding="utf-8"?>
<SwatchLibrary xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Name="Windows Phone 7" xmlns="http://schemas.microsoft.com/expression/design/2007">
<SolidColorSwatch Color="#FF000000" />
<SolidColorSwatch Color="#FFFFFFFF" />
<SolidColorSwatch Color="#FF181C18" />
<SolidColorSwatch Color="#FFFF0094" />
<SolidColorSwatch Color="#FFA500FF" />
<SolidColorSwatch Color="#FF00AAAD" />
<SolidColorSwatch Color="#FF8CBE21" />
<SolidColorSwatch Color="#FF9C4D00" />