Skip to content

Instantly share code, notes, and snippets.

@muojp
muojp / Dockerfile
Created December 27, 2014 17:41
KRE-Mono 1.0.0-beta1 + sample code
FROM mono:3.10
ENV KRE_VERSION 1.0.0-beta1
ENV KRE_USER_HOME /opt/kre
RUN apt-get -qq update && apt-get -qqy install unzip
RUN curl -sSL https://raw.githubusercontent.com/aspnet/Home/v$KRE_VERSION/kvminstall.sh | sh
RUN bash -c "source $KRE_USER_HOME/kvm/kvm.sh \
&& kvm install $KRE_VERSION -a default \
@muojp
muojp / xaml.cs
Created December 4, 2014 13:03
Sketching w/ Xamarin.Forms XAML
using Xamarin.Forms;
using System.Reflection;
using System.Runtime.CompilerServices;
using Xamarin.Forms.Xaml;
var xaml = @"<?xml version=""1.0"" encoding=""utf-8"" ?>
<ContentPage xmlns=""http://xamarin.com/schemas/2014/forms""
xmlns:x=""http://schemas.microsoft.com/winfx/2009/xaml""
x:Class=""XamlSamples.HelloXamlPage""
Title=""Hello XAML Page""
@muojp
muojp / jp.muo.gitupdater.plist
Created March 9, 2014 08:35
Macでgitリポジトリを毎晩寝てる間に同期する方法 ref: http://qiita.com/muo_jp/items/de57c590942e4ef49c9f
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd" >
<plist version="1.0">
<dict>
<key>Label</key>
<string>jp.muo.gitupdater</string>
<key>EnableGlobbing</key>
<true/>
<key>ProgramArguments</key>
final AudioTrack track = new AudioTrack(
AudioManager.STREAM_MUSIC, AUDIO_SAMPLING_RATE,
AudioFormat.CHANNEL_OUT_MONO,
AudioFormat.ENCODING_DEFAULT, AUDIO_TOTAL_BYTES,
AudioTrack.MODE_STREAM);
track.setPlaybackPositionUpdateListener(
new AudioTrack.OnPlaybackPositionUpdateListener() {
@Override
public void onMarkerReached(AudioTrack track) {
track.stop();
@muojp
muojp / gist:7264813
Created November 1, 2013 12:37
Android NDK r9bでの、RenderScript以外の変更点をひとまずdiff取ったのであとで見る用に貼り
diff --git a/android-ndk-r9/docs/APPLICATION-MK.html b/android-ndk-r9b/docs/APPLICATION-MK.html
index ecdd3ac..004c59a 100644
--- a/android-ndk-r9/docs/APPLICATION-MK.html
+++ b/android-ndk-r9b/docs/APPLICATION-MK.html
@@ -242,8 +242,8 @@ define a few variables:</p>
<hr />
<p><code>NDK_TOOLCHAIN_VERSION</code></p>
<blockquote>
-<p>Define this variable to either 4.4.3 or 4.6 to select version of GCC compiler.
- 4.6 is the default</p>
@muojp
muojp / gist:7264689
Created November 1, 2013 12:27
Android NDK r9bでのドキュメント変更点がすごいと(自分の中で)話題に
$ git diff --name-status android-ndk-r9/docs android-ndk-r9b/docs | grep -v 'renderscript'
M android-ndk-r9/docs/APPLICATION-MK.html
M android-ndk-r9/docs/CHANGES.html
M android-ndk-r9/docs/CPU-ARCH-ABIS.html
M android-ndk-r9/docs/DEVELOPMENT.html
M android-ndk-r9/docs/STANDALONE-TOOLCHAIN.html
M android-ndk-r9/docs/sidenav.html
M android-ndk-r9/docs/text/APPLICATION-MK.text
M android-ndk-r9/docs/text/CHANGES.text
M android-ndk-r9/docs/text/CPU-ARCH-ABIS.text
@muojp
muojp / gist:6227796
Created August 14, 2013 03:36
https://github.com/kmuto/review/pull/181 これを1.8.xと1.9.xで共に問題なく実行できそうなパッチ(VMの気持ちで考えたけど1.9.x試してない)
$ git diff -p
diff --git a/lib/review/htmlutils.rb b/lib/review/htmlutils.rb
index 64ef016..514ff53 100644
--- a/lib/review/htmlutils.rb
+++ b/lib/review/htmlutils.rb
@@ -39,15 +39,19 @@ module ReVIEW
begin
require 'pygments'
- Pygments.highlight(
.method assembly static pinvokeimpl ("MSVCR110D.dll" as "malloc" cdecl lasterr )
default void* modopt ([mscorlib]System.Runtime.CompilerServices.CallConvCdecl) malloc (unsigned int32 A_0) cil managed preservesig
{
.custom instance void class [mscorlib]System.Security.SuppressUnmanagedCodeSecurityAttribute::'.ctor'() = (01 00 00 00 ) // ....
// Method begins at RVA 0x0
} // end of global method malloc
$ cat t.php
<?php
error_reporting(E_ALL);
typoclsname;
kei-mba13:tmp KeiNakazawa$ php t.php
Notice: Use of undefined constant typoclsname - assumed 'typoclsname' in /tmp/t.php on line 3
@muojp
muojp / gist:4021738
Created November 6, 2012 01:01
binary format difference between Mono 3.0.0 bundled version of libgdiplus and my build
$ gobjdump -p /Library/Frameworks/Mono.framework/Versions/3.0.0_stable/lib/libgdiplus.dylib | head
/Library/Frameworks/Mono.framework/Versions/3.0.0_stable/lib/libgdiplus.dylib: ファイル形式 mach-o-i386
Mach-O header:
magic : feedface
cputype : 00000007 (i386)
cpusubtype: 00000003
filetype : 00000006 (dylib)
ncmds : 0000001c (28)
sizeofcmds: 00000b38