Skip to content

Instantly share code, notes, and snippets.

View paralleltree's full-sized avatar
🐱
Meow

Ryo Namiki paralleltree

🐱
Meow
View GitHub Profile
# Author: Pieter Noordhuis
# Description: Simple demo to showcase Redis PubSub with EventMachine
#
# Update 7 Oct 2010:
# - This example does *not* appear to work with Chrome >=6.0. Apparently,
# the WebSocket protocol implementation in the cramp gem does not work
# well with Chrome's (newer) WebSocket implementation.
#
# Requirements:
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby
@Gab-km
Gab-km / github-flow.ja.md
Last active April 23, 2025 04:19 — forked from juno/github-flow.ja.md
GitHub Flow (Japanese translation)
@rummelonp
rummelonp / zsh_completion.md
Last active February 22, 2023 15:06
zsh の補完関数の自作導入編

zsh の補完関数の自作導入編

あまり深く理解してないので識者のツッコミ大歓迎

補完を有効にする

取り敢えず最低限だけ

# 補完を有効にする
@repeatedly
repeatedly / msgpack_issue_121.md
Last active November 30, 2021 02:09
MessagePackが文字列とバイナリをわけないのは問題?

MessagePackが文字列とバイナリをわけないのは問題?

msgpack/msgpack#121

Objective Cの実装使ってるとある問題にぶちあたった.なので,文字列をちゃんとバイナリ(Raw)と分けるべき,という提案

(*) 俺は熟読したわけではないので,中身が気になる人はちゃんと本スレを読みましょう

そもそもMessagePackとは

@ishikura
ishikura / memomemo
Created February 28, 2013 01:16
LivetでView側からViewModel側の引数付きメソッドを実施する時(引数はとりあえずstringのみ確認した)のちょっとメモ。以下の2通りのやり方で引き渡せた。使い分けとか他にもっといい方法が…とかは今後。
<!--その1 MethodParameterに文字列を設定 -->
・View(XAML)側
<Button Content="AC" Name="buttonAC">
<i:Interaction.Triggers>
<i:EventTrigger EventName="Click">
<l:LivetCallMethodAction MethodName="ClearButton" MethodTarget="{Binding}" MethodParameter="AC"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</Button>
@rtanote
rtanote / livet-savedlg.cs
Created June 5, 2013 01:01
Livetを使ったファイル保存ダイアログの実装例
/* xaml
<Button Content="export" IsEnabled="{Binding ExportCommand.CanExecute}">
<i:Interaction.Triggers>
<i:EventTrigger EventName="Click">
<l:SaveFileDialogInteractionMessageAction>
<l:DirectInteractionMessage CallbackCommand="{Binding ExportCommand}">
<l:SavingFileSelectionMessage Filter="{Binding ExportFilter}" />
</l:DirectInteractionMessage>
</l:SaveFileDialogInteractionMessageAction>
</i:EventTrigger>
@Akkiesoft
Akkiesoft / lcd.rb
Last active March 29, 2017 09:20
ストロベリー・リナックスのSB1602BWかスイッチサイエンスのI2C LCDを使って、Felica系カードの残高を表示するスクリプト。OSCのデモとかで使用中。
# coding: utf-8
# IC balance checker / 2013-2015 @Akkiesoft
# Licence:
# MIT License
# references:
# http://homepage3.nifty.com/slokar/pasori/libpafe-ruby.html
# http://iccard.jennychan.at-ninja.jp/format
require 'wiringpi'
@nanase
nanase / pi2.c
Created October 29, 2013 05:10
モンテカルロ法
char mes0[] = { 0xe8, 0xa8, 0x88, 0xe7, 0xae, 0x97, 0 , 0 , 0, 0 , 0 , 0 ,0}
, mes1 [ ] = { 0 , 0 , 0 , 0 , 0 , 0 , 0xe5 , 0x9b , 0x9e , 0xe6 , 0x95 , 0xb0
, 0xe3, 0x82, 0x92, 0xe5 , 0x85, 0xa5 , 0xe5 , 0x8a , 0x9b , 0x3a , 0x20 , 0 , 0 , 0
, 0 } , mes2 [ ] = { 0x25 , 0x6c , 0x6c , 0x64 , 0 } , mes3 [ ] = { 0 , 0 , 0 , 0
, 0 , 0 , 0xe4 , 0xb8 , 0xad , 0x2e , 0x2e , 0x2e , 0x28 , 0x25 , 0x36 , 0x2e , 0x32
, 0x66 , 0x25 , 0x25 , 0x29 , 0x20 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } , mes4 [ ] = { 0x50
, 0x49 , 0x20 , 0x3d , 0x20 , 0x25 , 0x2e , 0x36 , 0x66 , 0xa , 0 , 0 } , mes5 [ ] = { 0xa
, 0 , 0 , 0 , 0 , 0 ,0,0xe5, 0xae
, 0x8c , 0xe4,0xba ,0x86 , 0xa ,
@thomaslevesque
thomaslevesque / CustomDragCursor.cs
Created May 2, 2014 22:55
Drag and drop with custom cursor
void Main()
{
var pb = new PictureBox { Image = Image.FromFile(@"D:\tmp\dotnet.png") };
bool down = false;
Cursor dragCursor = null;
pb.MouseDown += (sender, e) => down = true;
pb.MouseUp += (sender, e) => { down = false; dragCursor = null; };
pb.MouseMove += (sender, e) =>
{
if (down)
//2本接続
var observable = t.Streaming.StartObservableStream(StreamingType.User);
var disposable1 = observable.OfType<StatusMessage>().Subscribe(s => Console.WriteLine("status"));
var disposable2 = observable.OfType<EventMessage>().Subscribe(e => Console.WriteLine("event"));
//1本接続
var observable = t.Streaming.StartObservableStream(StreamingType.User).Publish();
observable.OfType<StatusMessage>().Subscribe(s => Console.WriteLine("status"));
observable.OfType<EventMessage>().Subscribe(e => Console.WriteLine("event"));
var disposable = observable.Connect();