Skip to content

Instantly share code, notes, and snippets.

// ==UserScript==
// @name Wikipedia Hukkatsu
// @namespace http://ssig33.com/
// @description Wikipedia ga Hukkatsu Suru
// @include http://en.wikipedia.org/*
// ==/UserScript==
var wikipedia = function(){
var ns =document.querySelectorAll('div');
for(i in ns){
try{
@pmdarrow
pmdarrow / iterm-launcher.js
Last active September 14, 2017 20:52
Launch iTerm 2 with a predefined tab & split configuration using Apple's "Javascript for Automation"
/**
* AppleScript to launch iterm2 terminals/tabs with configurable:
* ~ Name <name>
* ~ List of commands <cmds>
* ~ Split behavior horizontal(h) or vertical(v) <split> :: (h, v)
*
* Run from terminal with `osascript iterm-launcher.js`.
* Don't unfocus with the mouse/keyboard while executing the script.
*
* JS port of https://github.com/luismartingil/scripts/blob/master/iterm_launcher02.applescript
@satoshin2071
satoshin2071 / gist:aefc23c2aa968cc27fe3
Last active November 13, 2018 07:41
CoreFoundation Intro

#CoreFoundation入門 イントロ

##概要

デバッグ中にCF〜とかコンソールに表示されるが、そもそもCoreFoundationとはなんぞ?というレベルなのでこの機会に調べてみたいと思った。

以下をガイドとしてCoreFoundation の世界に飛び込みたい。

永野哲久氏[Hello, Core Foundation]

@satoshin2071
satoshin2071 / gist:08daecc13c9e293e70d3
Last active February 25, 2019 13:17
CoreFoundation入門 Toll-free bridge

#CoreFoundation入門 Toll-free bridge

##概要 CoreFoundation入門 CFStringとその周辺の続き。

CoreFoundation入門 イントロで説明したFoundationとCoreFoundationの互換性を実現するToll-free bridgeの仕組みを確認していく。

##Tool-free bridgeとは

CocoaのオブジェクトをCoreFoundationから、そしてCoreFoundationのオブジェクトをCocoaから呼ぶ事ができる仕組み。

@satoshin2071
satoshin2071 / gist:cc3a982b9b65dc9b8f20
Last active May 26, 2020 07:52
CoreFoundation入門 基本クラス

#CoreFoundation入門 基本クラス

##概要

Core Foundationで頻出するドキュメントにて「Derived from CFPropertyList」となっている以下の基本クラスを確認。

CFData, CFString, CFArray, CFDictionary, CFDate, CFNumber(CFBoolean)

※CFNumber、CFDate以外は上記のImutable型に対してそれぞれMutablel型が用意されている。

@satoshin2071
satoshin2071 / gist:249d42fc563ce98b410b
Created November 27, 2014 08:20
#CoreFoundation入門 基本クラス その2

#CoreFoundation入門 基本クラス その2

概要

一回目の続き

CFData

bytebufferを扱う(ラッパー)クラス。NSDataとToll-free bridgingが可能

@satoshin2071
satoshin2071 / gist:c99400015b95060d4e63
Last active April 2, 2021 21:59
CoreFoundation入門 メモリ管理

#CoreFoundation入門 メモリ管理

##概要

CoreFoundationのルートクラス的存在であるCFTypeの中から一番使用するであろう、メモリ管理関連のメソッドを確認。

##リファレンスカウント方式のメモリ管理

CoreFoundationはObjective-Cと同様の生成/保持/解放のリファレンスカウント方式。生成したらオーナーシップを持ち、必要なくなったらオーナーシップを破棄するのが必須なのも一緒。

@satoshin2071
satoshin2071 / gist:e8636d042e0c403ce287
Last active January 5, 2024 16:41
CoreFoundation入門 CFStringとその周辺

#CoreFoundation入門 CFStrringとその周辺

##概要

入門 イントロのHello,Worldで使用した「CFSTR("Hello, World!")」からCoreFoundationの実装を追っていく。

##CFStringの実装

まずはCFSTRのリファレンスを確認。CFStringRef型ということわかる。