Skip to content

Instantly share code, notes, and snippets.

View kana's full-sized avatar

Kana Natsuno kana

View GitHub Profile
@kana
kana / gist:975959
Created May 17, 2011 04:32
FileType test
" comment
; comment
# comment
@kana
kana / minq.cs
Created May 26, 2011 10:15
Learning LINQ by reimplementing
[TestClass()]
public class IMyEnumerableTest
{
[TestMethod()]
public void MyCastTest()
{
var xs = new [] {1, 2, 3}.MyCast();
Assert.IsTrue(xs is IMyEnumerable<Int32>);
var i = 1;
try ResourceSpecification
Block
{
final VariableModifiers_minus_final R #resource = Expression;
Throwable #primaryException = null;
try ResourceSpecificationtail
Block
catch (final Throwable #t) {
<title>title</title>
<p>p</p>
@kana
kana / gist:1033263
Created June 18, 2011 16:48
MacBook + WiMAX (UD01NA) = XXX
MacBookにWiMAXのUD01NAのドライバなんだかなんだかをインストールする
→UD01NAでインターネット接続できるようにする
→Internet Sharingを有効にする(AirPortからUD01NAへ)
→iPad 2からMacBookのAirPort経由でインターネット接続できるようにする
→iPad 2からインターネットへ向けてパケットを送信する
→MacBookがクライマックス
100%再現する。うわあああ
@kana
kana / MaybeTest.cs
Created June 22, 2011 10:07
Monad in C# (work in progress)
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using MonadSharp;
namespace Test
{
[TestClass()]
public class Test
{
nnoremap <Leader>pa :<C-u>call PerlReplacePackageName()<CR>
function! PerlPackageNameFromFile()
let filename = expand('%:p')
let package = substitute(filename, '^.*/lib/', '', '')
let package = substitute(package, '\.pm$', '', '')
let package = substitute(package, '/', '::', 'g')
return package
endfunction
@kana
kana / gist:1094888
Created July 20, 2011 12:43
Vim Version Manager
kana@avril ~/working/vim-version-manager (2) [master]
YUKI.N> vim --version
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Jul 20 2011 21:39:43)
MacOS X (unix) version
Included patches: 1-233
Compiled by [email protected]
Huge version without GUI. Features included (+) or not (-):
+arabic +autocmd -balloon_eval -browse ++builtin_terms +byte_offset +cindent
-clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments
+conceal +cryptv -cscope +cursorbind +cursorshape +dialog_con +diff +digraphs
" Quick and dirty solution to http://mobile.twitter.com/nelstrom/status/113572537610416128
" http://stackoverflow.com/questions/7400743/create-a-mapping-for-vims-command-line-that-escapes-the-contents-of-a-register-b
" https://github.com/kana/vim-operator-user
map YourFavoriteKeySequence <Plug>(operator-search-target-text)
call operator#user#define('search-target-text', 'OperatorSerachTargetText')
function! OperatorSerachTargetText(motion_wise)
execute 'normal!' '`['.operator#user#visual_command_from_wise_name(a:motion_wise).'`]"xy'
let @/ = '\V' . escape(substitute(@x, '[\r\n]$', '', ''), '\')
normal! n
endfunction
@kana
kana / README.txt
Created September 30, 2011 14:23
th07
.