Skip to content

Instantly share code, notes, and snippets.

@tmiz
tmiz / main.m
Created December 20, 2011 03:13
interposing on objc sample
// (C)2011 to3oo mi2ukam1 tmiz.net
//
// interposing on objc sample
// $ g++ main.m -framework cocoa
// $ ./a.out
// 2011-12-20 12:12:37.159 a.out[533:903] hello
// 2011-12-20 12:12:37.164 a.out[533:903] world
#include <cocoa/cocoa.h>
#include <objc/objc-class.h>
@tmiz
tmiz / KVOTest.cs
Created December 15, 2011 20:24
KVOTest.cs 005 Last
using System;
using System.Threading;
using MonoMac.Foundation;
namespace KVOTestClock
{
[Register("KVOTest")]
public class KVOTest : NSObject
{
public KVOTest ()
@tmiz
tmiz / KVOTest.cs
Created December 15, 2011 20:14
KVOTest.cs 004
using System;
using System.Threading;
using MonoMac.Foundation;
namespace KVOTestClock
{
[Register("KVOTest")]
public class KVOTest : NSObject
{
public KVOTest ()
@tmiz
tmiz / KVOTest.h
Created December 15, 2011 19:11
Generated header
// WARNING
// This file has been generated automatically by MonoDevelop to
// mirror C# types. Changes in this file made by drag-connecting
// from the UI designer will be synchronized back to C#, but
// more complex manual changes may not transfer correctly.
#import <Cocoa/Cocoa.h>
#import <Foundation/Foundation.h>
@tmiz
tmiz / KVOTest.cs
Created December 15, 2011 19:06
KVOTest.cs 003
using System;
using MonoMac.Foundation;
namespace KVOTestClock
{
[Register("KVOTest")]
public class KVOTest : NSObject
{
public KVOTest ()
{
@tmiz
tmiz / KVOTest.cs
Created December 15, 2011 18:52
KVOTest.cs 002
using System;
using MonoMac.Foundation;
namespace KVOTestClock
{
[Register("KVOTest")]
public class KVOTest : NSObject
{
public KVOTest ()
{
@tmiz
tmiz / KVOTest.cs
Created December 15, 2011 18:49
generated KVOTest.cs
using System;
namespace KVOTestClock
{
public class KVOTest
{
public KVOTest ()
{
}
}
@tmiz
tmiz / MainWindowController.cs
Created December 14, 2011 06:13
Example MonoMac 0001
using System;
using System.Collections.Generic;
using System.Linq;
using MonoMac.Foundation;
using MonoMac.AppKit;
namespace MonoDemoProject
{
public partial class MainWindowController : MonoMac.AppKit.NSWindowController
{
@tmiz
tmiz / monotest.py
Created December 13, 2011 04:40
IronPython Sample
#!/usr/bin/env ipy
import clr
clr.AddReference("System.Windows.Forms")
clr.AddReference('System.Drawing')
import System.Windows.Forms
import System.Drawing
myForm = System.Windows.Forms.Form()
myForm.Text = "2011 Mac Dev JP Advent Calendar"
myForm.Show()
@tmiz
tmiz / main.c
Created December 8, 2011 12:28
a sample which using openssl
#include <stdio.h>
#include <string.h>
#include "openssl/opensslv.h"
#include "openssl/sha.h"
void printBufferOfSha256(const unsigned char *output)
{
int i = 0;
for(; i < SHA256_DIGEST_LENGTH; i++) {