Skip to content

Instantly share code, notes, and snippets.

View walkure's full-sized avatar
🦆
鴨川ラジオ体操同好会

walkure walkure

🦆
鴨川ラジオ体操同好会
View GitHub Profile
@walkure
walkure / ControlInvokerEx.cs
Created June 2, 2014 15:34
スタックトレースを握りつぶさないよう頑張ってみたControl.Invoke拡張メソッド cf. http://www2.hatenadiary.jp/entry/2014/06/03/003344
public static class ControlInvokerEx
{
public static object InvokeEx(this Control ctl, Delegate act)
{
return InvokeEx(ctl,act,null);
}
public static object InvokeEx(this Control ctl, Delegate act,params object[] args)
{
if (!ctl.InvokeRequired)
@walkure
walkure / wmr100.c.diff
Created October 18, 2014 05:11
workaround patch for https://github.com/barnybug/wmr100/ (commit d28e072) building/running on Raspbian(libzmq1 2.2.0+dfsg-2)
diff --git a/wmr100.c b/wmr100.c
index 9b43c21..d6f3153 100644
--- a/wmr100.c
+++ b/wmr100.c
@@ -271,6 +271,7 @@ void wmr_output_stdout(WMR *wmr, char *msg) {
}
void wmr_output_zmq(WMR *wmr, char *topic, char *msg) {
+ zmq_msg_t zmsg;
int len = strlen(topic) + 1 + strlen(msg);
@walkure
walkure / gist:2219063
Created March 27, 2012 18:47
find the oldest user in KMC(Kyoto univ. Microcomputer Club) member list
#!/usr/bin/env perl
use strict;
use warnings;
use Date::Parse;
use Net::Twitter::Lite;
my $nt = Net::Twitter::Lite->new(
consumer_key => 'consumer key',
consumer_secret => 'consumer secret',
@walkure
walkure / autoniseho.pl
Created April 6, 2012 02:00
automatic niseho(にせほー) poster(implement handshake ver.)
#!/usr/bin/env perl
use strict;
use warnings;
use Encode;
use OAuth::Lite::Consumer;
use IO::Socket::SSL;
use JSON;
use Date::Parse;
@walkure
walkure / autoniseho.pl
Created April 6, 2012 02:03
automatic niseho(にせほー) poster(AnyEvent ver.)
#!/usr/bin/env perl
use strict;
use warnings;
use AnyEvent::Twitter;
use AnyEvent::Twitter::Stream;
use Encode;
use Date::Parse;
@walkure
walkure / upsmon.pl
Created October 11, 2012 14:24
UPS Monitor
#!/usr/bin/env perl
use strict;
use Device::SerialPort;
use IO::Socket;
use IO::Pipe;
use IO::Select;
my $pipe = IO::Pipe->new();
my $pid = fork();
@walkure
walkure / IRCSay.pm
Last active December 10, 2015 15:08
IRCプロキシ経由で発言するperl module
package IRCSay;
use strict;
use warnings;
use IO::Socket;
use Encode;
sub new
{
my $class = shift;
@walkure
walkure / jma_push_subscriber_sample.pl
Last active December 10, 2015 21:28
気象庁の防災情報PuSH試行試行配信を受信するサブスクライバCGIの例 (cf. http://d.hatena.ne.jp/W53SA/20130109/1357750514 )
#!/usr/bin/env perl
#cf. http://d.hatena.ne.jp/W53SA/20130109/1357750514
use strict;
use LWP::Simple;
use XML::Atom::Feed;
use URI;
use File::Basename;
use Digest::HMAC_SHA1;
@walkure
walkure / URIShorten.pm
Created January 13, 2013 17:27
URI圧縮サービスを叩くwrapper
package URIShorten;
use strict;
use warnings;
use LWP::UserAgent;
use JSON::XS qw(decode_json);
use URI::Escape;
sub new
@walkure
walkure / HTTProxy.cs
Created September 12, 2015 13:00
HttpListenerを使ってFiddlerCoreを代替してみた http://www2.hatenadiary.jp/entry/2015/09/12/220008
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
using System.Net;
using System.IO;
using System.Threading;
namespace KCB2