Skip to content

Instantly share code, notes, and snippets.

@novi
novi / gist:1631319
Created January 18, 2012 05:50
Arch LinuxをMacBook Air 3,2のSDカードにインストールメモ

Arch LinuxをMacBook Air 3,2のSDカードにインストールメモ

Bootcampの領域を壊さずに内蔵SDカードリーダーのSDメモリへインストールしてみた。

パーティション

  • /dev/disk0s1: EFIシステム
  • /dev/disk0s2: HFS+ OS X Lion (rEFItをインストール済)
  • /dev/disk0s3: Recovery (OS X Lion)
  • /dev/disk0s4: Windows 7
@novi
novi / CoreFoundationOwnClassTest.c
Created October 28, 2010 08:39
Create your own CFType Class
// Created by Yusuke Ito, @novi_
#include <CoreFoundation/CoreFoundation.h>
#define UseCFHeader 0
#if UseCFHeader
#include "CFRuntime.h"
#else
@novi
novi / perso_b.c
Last active May 13, 2020 14:56
Playing audio file (PCM) on NEXTSTEP 3.3
//Written by J. Laroche at the Center for Music Experiment at UCSD, San Diego //California. December 1990.
// File useful to test the stream control capabilities of the driver for
// writing streams (to the DACS). Currently (V. 2.0 prerelease fushia),
// aborting the stream wedges more or less the driver.
// Moreover, pause and resume work on any tagged region, whatever its tag is.
#import <sound/sound.h>
#import <sound/sounddriver.h>
#import <mach/mach.h>
#import <mach/mach_error.h>
@novi
novi / gist:1805373
Created February 12, 2012 00:43
Node.js 開発環境 基礎

Node.js 開発環境 基礎

Node.jsのインストール

OS X ならHomebrewまたはMacportsで。

[~] $ brew install node
[~] # port install node

nodeコマンドでnodeのインタプリタを起動。

$version = "2.0.5"
$hash = "4cb9620fbb68571be11ba13afc8911fd434561b9ff661040a128618af19bbbb5"
class Cmysql < Formula
homepage "https://github.com/novi"
url "https://github.com/novi/cmysql/archive/#{$version}.tar.gz"
sha256 $hash
version $version
depends_on "pkg-config"
@novi
novi / logger.js
Created February 14, 2012 20:27
node-http-proxyを使ったいわゆるバーチャルホスト対応Webサーバー(WebSocket対応版)
var http = require('http'),
httpProxy = require('http-proxy'),
logger = require('./logger');
// localhost:8001 に普通のExpressアプリ -> http://test.nov1.jp/
// localhost:8002 にWebSocketを使ったExpressアプリ -> http://😄.nov1.jp/, http://chat.nov1.jp/
// Proxy for Chat app
var proxy = new httpProxy.HttpProxy({
target: {
@novi
novi / swift-on-arch-linux.md
Last active July 13, 2018 07:09
Swift on Arch Linux

Install debootstrap.

# pacman -S arch-install-scripts debootstrap

Install Ubuntu base system into $ROOTFS.

$ export ROOTFS=$HOME/rootfs
@novi
novi / cmysqlmariadb.rb
Created July 3, 2018 07:15
Homebrew Formula for cmysql-mariadb
$version = "2.1.0"
$hash = "3c8402e3cd8d0690638c41afd35ae1ee4fc9e3cd5b7010a39a917630333c40ae"
class Cmysqlmariadb < Formula
homepage "https://github.com/novi"
url "https://github.com/novi/cmysql-mariadb/archive/#{$version}.tar.gz"
sha256 $hash
version $version
depends_on "pkg-config"
@novi
novi / pdfwalker.on.Mac.txt
Created June 17, 2011 15:56
PDFWalkerインストール on Mac OS X 10.6.7
* brew install libtiff
* brew install gtk+
** gtk+のインストールに失敗するときは、 https://twitter.com/novi_/status/81740297842868225
** /usr/local/lib/libintl.dylibが無いときは、 https://twitter.com/novi_/status/81742895941558272
* gem install origami gtk2
* mkdir -p ~/.local/share
** pdfwalkerが起動しないとkは、 /Library/Ruby/Gems/1.8/gems/origami-1.0.3/bin/pdfwalker:3 RUBY_VERSION を1.8以上にする
@novi
novi / CocoaDesignPattern-Summary.md
Created February 15, 2011 17:54
Cocoaのデザインパターンまとめ
  • Singleton
  • Abstract Factory - |NSWindow| (Theme, Style)
  • Builder - WebKit Document Representation
  • Prototype - |NSCollectionViewItem|, Cell
  • FactoryMethod - |NSDocument|, ClassCluster
  • Adapter - Delegate, CocoaBinding
  • Bridge - |NSImageRep|, Wrapper
  • Composite - View Hierarchy, Tree
  • Decorator - |NSBox|, |NSScrollView|
  • Facade - |NSTextView|