Skip to content

Instantly share code, notes, and snippets.

@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>
@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 \
$ sqlite3 t.db
SQLite version 3.7.7.1 2011-06-28 17:39:05
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> CREATE TABLE t1(_id INTEGER, col1 VARCHAR(255));
sqlite> select * from t1;
sqlite> .schema t1
CREATE TABLE t1(_id INTEGER, col1 VARCHAR(255));
sqlite> CREATE TABLE t2(_id INTEGER, col1 VARCHAR(255), col2 INTEGER, PRIMARY KEY(_id, col2));
sqlite> .schema t2
sqlite> CREATE TABLE t3(_id INTEGER PRIMARY KEY AUTOINCREMENT, col1 VARCHAR(255), col2 INTEGER);
sqlite> CREATE UNIQUE INDEX idx_uniq ON t3(_id, col1, col2);
sqlite> .schema t3
CREATE TABLE t3(_id INTEGER PRIMARY KEY AUTOINCREMENT, col1 VARCHAR(255), col2 INTEGER);
CREATE UNIQUE INDEX idx_uniq ON t3(_id, col1, col2);
@muojp
muojp / gist:3634179
Created September 5, 2012 09:40
末尾全角スペースの罠DBとか怖いって話を社内でしてた
mysql> create database `foo`;
mysql> create database `foo `;
mysql> create database `foo  `;
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| foo |
@muojp
muojp / gist:3786383
Created September 26, 2012 06:14
ARDrone SDK 2.0のビルドがコケるのをなんとかするパッチ
96c96
< grep -r ^\#define ../../ARDroneLib/Soft/Common/navdata_common.h | grep NB_NAVDATA_DETECTION_RESULTS | sed 's/^\#define NB_NAVDATA_DETECTION_RESULTS \(.*\)/\#define ARDRONE_MAX_ENEMIES \1/g' | sed 's/\/\*.*\*\///' >> Release/ARDroneGeneratedTypes.h
---
> grep -h -r ^\#define ../../ARDroneLib/Soft/Common/navdata_common.h | grep -h NB_NAVDATA_DETECTION_RESULTS | sed 's/^\#define NB_NAVDATA_DETECTION_RESULTS \(.*\)/\#define ARDRONE_MAX_ENEMIES \1/g' | sed 's/\/\*.*\*\///' >> Release/ARDroneGeneratedTypes.h
100c100
< grep -r ^LED_ANIMATION\( ../../ARDroneLib/Soft/Common/led_animation.h | tr -d ' ' | tr -d '\t' | sed 's/^LED_ANIMATION(\([A-Za-z_0-9=]*\),\(.*\))/ARDRONE_LED_ANIMATION_\1,/g' | sed 's/\/\*.*\*\///' >> Release/ARDroneGeneratedTypes.h
---
> grep -h -r ^LED_ANIMATION\( ../../ARDroneLib/Soft/Common/led_animation.h | tr -d ' ' | tr -d '\t' | sed 's/^LED_ANIMATION(\([A-Za-z_0-9=]*\),\(.*\))/ARDRONE_LED_ANIMATION_\1,/g' | sed 's/\/\*.*\*\///' >> Release/ARDroneGeneratedTypes.h
105c105
< grep -r "\s*A
@muojp
muojp / Main.cs
Created November 5, 2012 08:37
repro. code for JavaScriptSerializer bug in Mono 3.0
using System;
using System.Collections.Generic;
using System.Web.Script.Serialization;
namespace TestsForMono
{
class MainClass
{
public static void Main (string[] args)
{
@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
@muojp
muojp / Program.cs
Created October 20, 2015 12:55
Azure WebJobsからnode_modulesへインストールしたコマンドを呼び出す
using System;
using System.Diagnostics;
namespace TestJob
{
class Program
{
static void Main()
{
Console.WriteLine("testing node.js based command");
{
paths: {
/operators: {
post: {
parameters: [
{
schema: {
- $ref: "#/definitions/RegisterOperatorsRequest"
+ $ref: "#/definitions/CreateOperatorRequest"
}